#include <bits/stdc++.h> #define pi 2*acos(0) using namespace std; int main() { double s,a,b,c,tri_area,red_out,red_in; double area_circum,area_inscribed,area_triangle; while(scanf("%lf %lf %lf", &a, &b, &c)==3) { s=(a+b+c)/2;...
UVA Problem 11185 Solution
#include <stdio.h> int main() { long int dn,r,q; long int bn[10000],i,j; while(1) { scanf("%ld",&dn); if(dn<0) break; else if(dn==0) printf("0\n"); else { q=dn; i=0; while(q>0) { bn[i++]=q%3; q=q/3; } i=i-1; for(j=i;j>=0;j--) printf("%ld",bn[j]);...
UVa Problem 11192 Solution – Group Reverse
#include <bits/stdc++.h> using namespace std; int main() { char s[200]; int n,i,j,l,a; while(cin>>n) { if(n==0) break; scanf("%s",s); l=strlen(s); a=l/n; for(i = 0; i < l; i += a) { for(j = i+a-1; j >= i; j--) printf("%c",s[j]); } puts(""); }...
UVA Problem 11233 Solution – Deli Deli
#include <bits/stdc++.h> using namespace std; int main() { string ch1,ch2; map<string,string>m; int n,l,i,j,k; char c1,c2; cin>>l>>n; for(i=0;i<l;i++) { cin>>ch1>>ch2; m[ch1]=ch2; } for(i=0;i<n;i++){ cin>>ch2;...
UVA Problem 11332 Solution – Summing Digits
#include <bits/stdc++.h> using namespace std; int func_tion(int n) { int j,sum=0; if(n<10) return n; else { for(j=0;; j++) { sum+=n%10; n=n/10; if(n==0) break; } return func_tion(sum); } } int main() { int a,n,res,sum,k; while(cin>>n...
UVA Problem 11340 Solution – Newspaper
#include<stdio.h> #include<math.h> #include<string.h> #include<iostream> using namespace std; char ch1[10002]; int main() { int n,k,m,value[102],nn; char ch[302]; double s; scanf("%d",&n); while(n--) { s=0;...
UVA Problem 11344 Solution – The Huge One
#include <bits/stdc++.h> using namespace std; int main() { char m[1002]; int tc, l, n, i, j, r,sum,a[100]; bool flag; cin>>tc; while (tc--) { scanf("\r"); gets(m); l = strlen(m); cin>>n; for (i = 0; i < n; i++) cin>>a[i]; flag...
UVa Problem Solution 11371 – Number Theory for Newbies
#include <bits/stdc++.h> using namespace std; int main() { string n,a; long long s,b,c,d,l; while(cin>>n) { sort(n.begin(),n.end()); a=n; if(a[0]=='0') { for(int i=1;i<n.size();i++) { if(a[i]!='0') { swap(a[0],a[i]); break; } } }...
UVA Problem 11428 Solution – Cubes
#include <bits/stdc++.h> using namespace std; int main() { int n,a,b,i,j,x,y; bool penalty; while(cin>>n) { if(n==0) break; penalty=false; for(i=1;i<n;i++) { for(j=0;j<=i;j++) { if((i*i*i-j*j*j)==n) { cout<<i<<"...
Uva Problem Solution 11461 – Square Numbers
#include <bits/stdc++.h> using namespace std; int main() { long long int n,m,i,b,count; while(scanf("%lld %lld",&n,&m)==2) { if(n==0 && m==0) break; count=0; for(i=n;i<=m;i++) { b=sqrt(i); if(i==(b*b)) count++; }...
UVA Problem 11462 Solution – Age sort
#include <bits/stdc++.h> using namespace std; long int ary[2000007]; int main() { int n,i,j,k; while (scanf("%ld",&n)==1) { if (n==0) { break; } for (i=0;i<n;i++) { scanf("%ld",&ary[i]); } sort(ary,ary+n); for (i=0;i<n;i++) {...
UVa Problem Solution 11479 – Is this the easiest problem?
#include<stdio.h> int main() { long int t,a,b,c,i; while(scanf("%ld",&t)==1) { for(i=1; i<=t; i++) { scanf("%ld %ld %ld", &a, &b, &c); if ((a+b)<=c || (b+c)<=a || (c+a)<=b || a<=0 || b<=0 || c<=0) printf("Case %ld:...
UVA Problem 11494 Solution – Queen
#include <bits/stdc++.h> using namespace std; int main() { int x1,x2,y1,y2; while(cin>>x1>>y1>>x2>>y2) { if(x1==0 && y1==0 && x2==0 && y2==0) break; if(x1==x2 and y1==y2) printf("0\n"); else if(...
Uva problem Solution-11498 – Division of Nlogonia
#include <bits/stdc++.h> using namespace std; int main() { int tc,n,m,x,y; while(cin>>tc) { if(tc==0) break; cin>>n>>m; for(int i=0;i<tc;i++) { cin>>x>>y; if(x==n || y==m) cout<<"divisa\n"; else if(x>n and...
UVA Problem 11530 Solution – SMS Typing
#include<bits/stdc++.h> using namespace std; int main() { char l,s[105]; int c,j,t,i; scanf("%d%*c",&t); for(i=1;i<=t;i++) { c=0; gets(s); l=strlen(s); for(j=0;j<l;j++) {...
UVA Problem Solution11541 – Decoding
#include <bits/stdc++.h> using namespace std; int main() { int tc,cases=0,j,r; char s[1000],c; cin>>tc; while(tc--) { scanf("\r"); gets(s); int l=strlen(s); printf("Case %d: ",++cases); for(int i=0;i<l;i++) { r=0;...
UVA Problem 11547 Solution – Automatic Answer
#include <bits/stdc++.h> using namespace std; int main() { int t = 0,i,n; cin >> t; while(t--) { int n = 0; cin >> n; n *= 567; n /= 9; n += 7492; n *= 235; n /= 47; n-= 498; n/=10; n%=10; printf("%d\n",abs(n)); } return 0; }...
struct and union in C
struct and union in C These both declare same and uses are almost same; just the difference when use struct then need to declare with ‘struct’ keyword struct student { int roll; float age; }; when use union then declare as union student { int roll; float age;...
UVA Problem 11559 Solution – Event Planning
#include <bits/stdc++.h> using namespace std; int main() { int p,b,h,w,price,i,a,j,s; while(scanf("%d %d %d %d",&p,&b,&h,&w)==4) { int cost=15000000; for(i=0;i<h;i++) { scanf("%d",&price); for(j=0;j<w;j++) { scanf("%d",&a);...
UVA Problem 11608 Solution – No Problem
#include <stdio.h> int main () { int problem1,prblm [20],required [20],tc = 0; while ( scanf ("%d", &problem1)== 1 ) { if ( problem1 < 0 ) return 0; prblm [0] = problem1; int i; for ( i = 1; i < 13; i++ ) scanf ("%d", &prblm [i]); for ( i =...
AI in Education: Navigating ChatGPT’s Dual Impact on Learning and Application Essays
Explore how AI tools like ChatGPT are reshaping education, from aiding learning to challenging academic integrity, especially in the realm of college application essays.
TypeScript’s Ascendancy & PHP’s Enduring Evolution: Navigating Modern Language Trends
Explore the latest developer ecosystem trends: TypeScript’s rapid growth and PHP’s mature, stable presence. Understand their impact on web development and career paths.
Laravel: The PHP Framework Powering Modern Web Applications
Discover Laravel, the open-source PHP framework renowned for its elegant syntax, robust features, and security, making web development enjoyable and efficient.
Laravel 10 Features: Empowering Web Artisans for Future-Ready Web Applications
Discover the powerful features of Laravel 10, the PHP Framework for Web Artisans. Learn how it enhances security, performance, and developer experience for modern web apps.




