Search found 10 matches

by rahat khan
Tue Aug 16, 2011 9:22 pm
Forum: Volume 110 (11000-11099)
Topic: 11057 - Exact Sum
Replies: 50
Views: 21920

Re: 11057 - Exact Sum

#include<stdio.h> int main() { long long n,i,m,c,a[11000],x,y,j; while(scanf("%lld",&n)!=EOF) { for(i=0;i<n;i++) { scanf("%lld",&a[i]); } scanf("%lld",&m); c=m; for(i=0;i<n-1;i++) { for(j=i+1;j<=n-1;j++) { if((a[i]+a[j])==m) { if((a[i]>a[j])&&(a[i]-a[j])<c) { x=i; y=j; } if((a[j]-a[i])<c) { x=i; y=...
by rahat khan
Thu Aug 04, 2011 10:42 am
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 61427

Re: 10035 - Primary Arithmetic

#include<stdio.h> int main() { long long a,b,c,m[100],n[100],x,y,i,e; while(scanf("%lld %lld",&x,&y)) { if(x==0&&y==0) break; c=0; if(a<b) { a=y; b=x; } else { a=x; b=y; } e=0; for(i=1;;i++) { m =a%10; m =m +e; a=a/10; n =b%10; b=b/10; if((m +n )>9) { c++; e++; } else e=0; if(a==0) break; } if(c==0)...
by rahat khan
Thu Aug 04, 2011 10:39 am
Forum: Volume 112 (11200-11299)
Topic: 11219 - How old are you?
Replies: 117
Views: 34661

Re: 10035 Primary Arithmetic

#include<stdio.h> int main() { long long a,b,c,m[100],n[100],x,y,i,e; while(scanf("%lld %lld",&x,&y)) { if(x==0&&y==0) break; c=0; if(a<b) { a=y; b=x; } else { a=x; b=y; } e=0; for(i=1;;i++) { m =a%10; m =m +e; a=a/10; n =b%10; b=b/10; if((m +n )>9) { c++; e++; } else e=0; if(a==0) break; } if(c==0)...
by rahat khan
Mon Jun 06, 2011 6:56 pm
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 61427

Re: 10035 - primary arithmetic

#include<stdio.h> #include<math.h> int main() { int a,b,c[10],d[10],i,j,x,y,m; while(1) { m=0; scanf("%d %d",&a,&b); if(a==0&&b==0) break; x=log10(a)+1; y=log10(b)+1; for(i=0;i<x;i++) { c =a%10; a=a/10; } for(j=0;j<y;j++) { d[j]=b%10; b=b/10; } if(x<=y) { for(i=0;i<x;i++) { if(c +d >9) { m=m+1; } } ...
by rahat khan
Fri May 27, 2011 10:57 am
Forum: Volume 100 (10000-10099)
Topic: 10071 - Back to High School Physics
Replies: 49
Views: 8104

Re:10071 Back to High School Physics

#include<stdio.h>
int main()
{
int s,v,t;
scanf("%d %d",&v,&t);
s=v*t;
s=s*2;
printf("%d\n",s);
return 0;
}
by rahat khan
Fri May 27, 2011 6:41 am
Forum: Volume 100 (10000-10099)
Topic: 10071 - Back to High School Physics
Replies: 49
Views: 8104

Re:10071 Back to High School Physics

#include<stdio.h>
int main()
{
int s,v,t;
scanf("%d %d",&v,&t);
s=v*t*2;
printf("%d\n",s);
return 0;
}
by rahat khan
Fri May 27, 2011 6:13 am
Forum: Volume 100 (10000-10099)
Topic: 10071 - Back to High School Physics
Replies: 49
Views: 8104

10071 - Back to High School Physics

#include<stdio.h>
int main()
{
int s,v,t;
scanf("%d %d",&v,&t);
s=v*t*2;
printf("%d\n",s);
return 0;
}
by rahat khan
Thu May 26, 2011 9:12 pm
Forum: Volume 112 (11200-11299)
Topic: 11219 - How old are you?
Replies: 117
Views: 34661

10075

#include<stdio.h>
int main()
{
int s,v,t;
scanf("%d %d",&v,&t);
s=v*t*2;
printf("%d\n",s);
return 0;
}
by rahat khan
Mon May 23, 2011 1:31 pm
Forum: Volume 112 (11200-11299)
Topic: 11219 - How old are you?
Replies: 117
Views: 34661

Re: 11219 - How old are you/

#include<stdio.h> int main() { int a,b,c,d,e,f,g,h,i,j,T; scanf("%d",&T); for(j=1;j<=T;j++) { scanf("%d/%d/%d%d/%d/%d",&a,&b,&c,&d,&e,&f); if(a>d) { if(b>e) { i=c-f; } if(b<e) { f=f+1; i=c-f; } } if(a<d) { e=e+1; if(b>=e) { i=c-f; } if(b<e) { f=f+1; i=c-f; } } if (i<0) printf("Case #%d: Invalid birt...
by rahat khan
Mon May 23, 2011 1:30 pm
Forum: Volume 112 (11200-11299)
Topic: 11219 - How old are you?
Replies: 117
Views: 34661

Re: 11219 - How old are you/

#include<stdio.h> int main() { int a,b,c,d,e,f,g,h,i,j,T; scanf("%d",&T); for(j=1;j<=T;j++) { scanf("%d/%d/%d%d/%d/%d",&a,&b,&c,&d,&e,&f); if(a>d) { if(b>e) { i=c-f; } if(b<e) { f=f+1; i=c-f; } } if(a<d) { e=e+1; if(b>=e) { i=c-f; } if(b<e) { f=f+1; i=c-f; } } if (i<0) printf("Case #%d: Invalid birt...

Go to advanced search