Search found 50 matches

by razibcse
Tue Aug 06, 2002 2:41 am
Forum: Volume 3 (300-399)
Topic: 350 - Pseudo-Random Numbers
Replies: 56
Views: 16102

350:Why WA

Why WA please infome me..kindly... #include <stdio.h> void main() { long int t,z,i,m,l,a,b[1000],c,d,e,x; for(e=1;;e++) { scanf("%ld %ld %ld %ld",&z,&i,&m,&l); if(z==0 && i==0 && m==0 && l==0) break; t=0; b[0]=l; for(c=1;;c++) { a=(z*l)+i; b[c]=a%m; for(d=c-1;d>=0;d--) if(b[d]==b[c]) { x=c-d; t=x; b...
by razibcse
Tue Aug 06, 2002 2:39 am
Forum: Volume 4 (400-499)
Topic: 499 - What's The Frequency, Kenneth?
Replies: 93
Views: 10213

499:Why WA

Why this gets WA..please let me know if anyone kindly sees it.. #include <stdio.h> #include <string.h> void main() { char w[1002],ch[1002],y[1002],t1; long q,h,f,t,l,n[1002],a,b,c,d,i,m,x; while(gets(w)) { d=0; b=strlen(w); for(a=0;a<b;a++) { t=1; if(w[a]==' ') continue; for(c=a+1;c<b;c++) { if(w[a]...
by razibcse
Tue Aug 06, 2002 2:33 am
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 29714

488: Please help me out from this WA

Program is in C..please help me..it always gets WA.. And what about the last line? #include <stdio.h> void main() { long a,f,b,i,j,k; scanf("%ld\n%ld",&a,&f); if(a<=9) { for(i=0;i<f;i++) { for(j=1;j<=a;j++) { b=j; for(k=1;k<=b;k++) printf("%ld",b); printf("\n"); } for(j=a-1;j>=1;j--) { b=j; for(k=1;...
by razibcse
Tue Aug 06, 2002 2:29 am
Forum: Volume 4 (400-499)
Topic: 490 - Rotating Sentences
Replies: 212
Views: 19302

490: Why WA

490: I always get WA...why this happens?Please tell me....Language:C #include <stdio.h> #include <string.h> void main() { char w[110][110],ww[110][110]; long t,x,a,b,c,d,i[110],k; a=0; while(gets(w[a])) { t=0; for(x=0;x<strlen(w[a]);x++) if(w[a][x]!=' ') { t++; ww[a][t]=w[a][x]; } i[a]=t; a++; } b=a...
by razibcse
Tue Aug 06, 2002 2:05 am
Forum: Volume 1 (100-199)
Topic: 160 - Factors and Factorials
Replies: 205
Views: 23896

160:Always WA..why?

Please tell me why it's Wrong answer....I did it in C #include <stdio.h> #include <math.h> void main() { long t,cn[30],p,pr[30],a,b,c,d,e,n,i,j; for(;;) { scanf("%ld",&n); if(n==0) break; d=0; for(a=2;a<=n;a++) { p=1; b=a; for(c=2;c<=sqrt(b);c++) if(!(b%c)) { p=0; break; } if(p) pr[d++]=b; } e=d; fo...

Go to advanced search