## Search found 15 matches

Sun Jun 30, 2002 11:04 pm
Forum: Volume 4 (400-499)
Topic: 492 - Pig-Latin
Replies: 213
Views: 24639
I have increased the array size and the intput without the ending dot
is also correct.
pls. tell me the bug of this.
Sun Jun 30, 2002 10:58 pm
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 29417
Take an extra input for case number though it is not
said to take in the problem.
Wish you good luck.
Sun Jun 30, 2002 10:52 pm
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 29417
Yes it has accepted.
Thanks to all..
Sun Jun 30, 2002 10:38 pm
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 29417
Is'nt a multiple input program?
Kindly tell me about blue flag.
Sun Jun 30, 2002 10:36 pm
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 29279
Sat Jun 29, 2002 5:33 am
Forum: Volume 5 (500-599)
Topic: 573 - The Snail
Replies: 45
Views: 18859
Yes it got accepted.
Sat Jun 29, 2002 5:27 am
Forum: Volume 4 (400-499)
Topic: 492 - Pig-Latin
Replies: 213
Views: 24639

### 492 - Pig-Latin

Please tell me why it is W.A. #include<stdio.h> #include<ctype.h> #include<iostream.h> int main() { int vo[10]={65,97,69,101,73,105,79,111,85,117}; int ch; char pig[10000]; int flag=0,flag1=1,flag2=0; int con; long l=0; while((ch=getchar())!=EOF) { if(isalpha(ch)!=0) { flag2=0; if(flag==0) { flag1=1...
Sat Jun 29, 2002 5:25 am
Forum: Volume 4 (400-499)
Topic: 455 - Periodic Strings
Replies: 73
Views: 16385

### 455 - Periodic Strings

Pleaes tell me the fault of this code. Why it is W.A?? #include<iostream.h> #include<string.h> int main() { char t[100]; int r; while(cin>>t) { int s=strlen(t); char p[100]; char ch[2]={0}; ch[0]=t[0]; strcpy(p,ch); int i; for(i=1,r=1;i<s;i++,r++) { int l,k=1,count,max,index=0,b=0; max=s-r+1; while(...
Sat Jun 29, 2002 5:22 am
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 29417

Can some one tell me why it is W.A?? #include<iostream.h> int main() { unsigned long a,f; while(cin>>a>>f) { if(a<=9) { for(unsigned long i=1;i<=f;i++) { unsigned long j; for(j=1;j<=a;j++) { for(unsigned long k=1;k<=j;k++) cout<<j; cout<<"\n"; } for(unsigned long l=j-2;l>=1;l--) { for(unsigned long ...
Fri Jun 28, 2002 7:30 pm
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 29279
At last it has accepted.
Fri Jun 28, 2002 10:56 am
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 29279
Can anyone help me with 495? Why my code get W.A.?? #include<iostream.h> #include<string.h> int main() { char *fibo[5001]={0}; fibo[0]="0"; fibo[1]="1"; int l1=strlen(fibo[0]); int l2=strlen(fibo[1]); int l; for(long i=2;i<=5000;i++) { char str[10000]; if(l1>=l2)l=l1; else l=l2; int ca=0; long j,k,m...
Fri Jun 28, 2002 10:44 am
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 29279

Can anyone tell me why this code of mine is W.A? #include<iostream.h> #include<string.h> int main() { char *fibo[5001]={0}; fibo[0]="0"; fibo[1]="1"; int l1=strlen(fibo[0]); int l2=strlen(fibo[1]); int l; for(long i=2;i<=5000;i++) { char str[10000]; if(l1>=l2)l=l1; else l=l2; int ca=0; long j,k,m,p;...
Fri Jun 28, 2002 10:19 am
Forum: Volume 5 (500-599)
Topic: 573 - The Snail
Replies: 45
Views: 18859
The number of this problem is 573.
Thu Jun 27, 2002 11:43 pm
Forum: Volume 5 (500-599)
Topic: 543 - Goldbach's Conjecture
Replies: 109
Views: 23339

### 543 - Goldbach's Conjecture

#include<iostream.h> #include<math.h> int main() { int prime[1000000]={0}; prime[2]=1; prime[3]=1; for(long k=5;k<1000000;k+=2) { int a=0; for(long l=3;l<k;l+=2) { if(prime[l]==1) { if(k%l==0) { a=1; break; } if(prime[l]>(long)(sqrt(k)+0.5))break; } } if(a==0)prime[k]=1; } long n; while(cin>>n&&n>0)...
Thu Jun 27, 2002 11:39 pm
Forum: Volume 5 (500-599)
Topic: 573 - The Snail
Replies: 45
Views: 18859

### 573 - The Snail

#include<iostream.h> int main() { double h,u,d,f; while(cin>>h>>u>>d>>f&&h>0) { double ih=0; double hc=ih+u; double hs=hc-d; double fa=(u*f)/100.00; long day=1; int a=0,b=0; do { ih=hs; u-=fa; if(u>=0) { hc=ih+u; } else hc=ih; hs=hc-d; day++; if(hs<0||hc>=h)b=1; if(hs<0)a=1; }while(b!=1); if(a==0) c...