Search found 9 matches

by woaraka92
Tue Jul 22, 2014 9:27 pm
Forum: Volume 102 (10200-10299)
Topic: 10235 - Simply Emirp
Replies: 150
Views: 32158

simply emrip 10235

whats wrong with this code?? #include<stdio.h> #include<math.h> int prime(long int n) { long int i; if(n==0) return 0; for(i=2;i<=sqrt(n);i++) { if(n%i==0) return 0; } return 1; } long int rev(long int n) { long int s=0; while(n!=0) { s=s*10+n%10; n/=10; } return s; } int main() { long int n,r; whil...
by woaraka92
Mon Jul 21, 2014 12:34 am
Forum: Volume 117 (11700-11799)
Topic: 11727 - Cost Cutting
Replies: 7
Views: 2885

11727 - Cost Cutting

whats wrong this code?? #include<stdio.h> int main() { int t,a,b,c,i; scanf("%d",&t); for(i=1;i<=t;i++) { scanf("%d%d%d",&a,&b,&c); if((a>=b && a<=c) || (a>=c && a<=b)) printf("Case %d: %d\n",i,a); else if((b>=a && b<=c) || (b>=c && b<=a)) printf("Case %d: %d\n",i,b); else printf("Case %d: %d\n",i,b...
by woaraka92
Sat Oct 26, 2013 8:42 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 55140

Re: UVA 10070

#include<stdio.h> #include<string.h> int main() { char a[1000000]; int i,y4,y15,y55,y100,y400,j=0; while(scanf("%s",a)==1){ y4=0;y15=0;y55=0;y100=0;y400=0; if(j!=0) printf("\n"); j=1; for(i=0;a !='\0';i++){ y4=y4*10+a -48; y4=y4%4; y15=y15*10+a -48; y15=y15%15; y55=y55*10+a -48; y55=y55%55; y100=y10...
by woaraka92
Wed Oct 23, 2013 9:18 pm
Forum: Volume 109 (10900-10999)
Topic: 10929 - You can say 11
Replies: 69
Views: 27154

Re: UVA 10929

Thanks brianfry713..
by woaraka92
Wed Oct 23, 2013 8:43 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 55140

Re: UVA 10070

Still wrong Answer brianfry713....
by woaraka92
Tue Oct 22, 2013 4:09 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 55140

Re: UVA 10070

Ok char a[1000000];
But still wrong answer brianfry713.
by woaraka92
Sun Oct 20, 2013 11:23 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 55140

UVA 10070

whats wrong?? #include<stdio.h> #include<string.h> int main() { char a[100000]; int i,y4,y15,y55,y100,y400; while(scanf("%s",a)==1){ y4=0;y15=0;y55=0;y100=0;y400=0; for(i=0;a !='\0';i++){ y4=y4*10+a -48; y4=y4%4; y15=y15*10+a -48; y15=y15%15; y55=y55*10+a -48; y55=y55%55; y100=y100*10+a -48; y100=y1...
by woaraka92
Sun Oct 20, 2013 7:33 pm
Forum: Volume 109 (10900-10999)
Topic: 10929 - You can say 11
Replies: 69
Views: 27154

Re: UVA 10929

whats the problem in this code?
by woaraka92
Sun Oct 20, 2013 7:28 pm
Forum: Volume 109 (10900-10999)
Topic: 10929 - You can say 11
Replies: 69
Views: 27154

UVA 10929

#include<stdio.h> #include<string.h> int main(){ char a[1002]; int i,sum; while(1){ scanf("%s",a); if(strcmp(a,"0")==0) break; sum=0; for(i=0;a !='\0';i++){ sum=sum*10+a -48; if(sum<11){ i++; sum=sum*10+a -48; } if(sum>10) sum=sum%11; } if(sum==0) printf("%s is a multiple of 11.\n",a); else printf("...

Go to advanced search