Search found 18 matches

by esharif
Wed Jun 13, 2012 12:06 pm
Forum: Volume 4 (400-499)
Topic: 458 - The Decoder
Replies: 71
Views: 14670

why WA for 458

I thing I'm in beginner label programming, let see the code:

Code: Select all

#include<stdio.h>
#include<string.h>
int main()
{
	int c;
	while((c=getchar()) !='\n')
	{
		if(c-7<0 && c-7>127)
			break;
		printf("%c", c-7);
	}
	printf("\n");
	return 0;
}
by esharif
Wed Jun 13, 2012 8:43 am
Forum: Volume 117 (11700-11799)
Topic: 11723 - Numbering Roads
Replies: 32
Views: 5993

Re: Why WA!! for 11723, help me please...

Input 8 4, output should be 1. Lets see now, #include<stdio.h> int main() { int R, N, n=1, temp, suff; while(n>0) { scanf("%d%d",&R,&N); if(R==0 && N==0) break; temp=R-N; if(temp>(26*N)) printf("Case %d: impossible\n",n++); else { if(temp%N==0) suff=temp/N; else if(temp%N>0) suff=(temp/N)+1; printf...
by esharif
Tue Jun 05, 2012 11:54 am
Forum: Volume 117 (11700-11799)
Topic: 11723 - Numbering Roads
Replies: 32
Views: 5993

11723 - Numbering Roads

Though I test all cases given by problem setter & from this site's user, but I still get WA. Why???? Here is my code below: #include<stdio.h> int main() { int R, N, n=1, temp, suff; while(n>0) { scanf("%d%d",&R,&N); if(R==0 && N==0) break; temp=R-N; if(temp>(26*N)) printf("Case %d: impossible\n",n++...

Go to advanced search