Search found 3 matches

by tasnif
Sat Apr 11, 2009 8:56 pm
Forum: Volume 115 (11500-11599)
Topic: 11577 - Letter Frequency
Replies: 19
Views: 7263

Re: 11577 - Letter Frequency

i am repeatedly getting wrong answer.but cant find any mistake.here is my code. #include<stdio.h> int array[26]; int main(void) { int testcase,testcount=1,i; char ch,dummy,largest; scanf("%d\n",&testcase); dummy=getchar(); while(testcount<=testcase) { scanf("%c",&ch); if(ch=='\n') { largest=array[0]...
by tasnif
Sun Apr 05, 2009 8:30 pm
Forum: Volume 2 (200-299)
Topic: 278 - Chess
Replies: 22
Views: 2563

Re: 278 Chess

the following code is giving wrong answer what is the problem? #include<iostream> using namespace std; int main(void) { int testno,testcase=1,product,m,n; char a; cin>>testno; while(testcase<=testno) { cin>>a>>m>>n; product=1; if(a=='r'||a=='q') { if(m<=n)cout<<m<<'\n'; else cout<<n<<'\n'; } else if...
by tasnif
Fri Apr 03, 2009 6:16 am
Forum: Volume 4 (400-499)
Topic: 483 - Word Scramble
Replies: 122
Views: 20340

Re: 483

here is my code i am getting a runtime error but cant fix whats thr problem.i have tested several inputs and every one of them gives the correct output. #include<stdio.h> #include<string.h> int main(void) { char p[101], temp; int i,k=0; int j; while(gets(p)!=NULL) { i=0; k=0; while(p[k]!='\0') { if(...

Go to advanced search