Search found 2 matches

by pnkj_agrl
Mon May 12, 2014 8:08 pm
Forum: Volume 7 (700-799)
Topic: 713 - Adding Reversed Numbers
Replies: 142
Views: 61342

Re: 713 - Adding Reversed Numbers

i got accepted in both spoj and codechef but giving wrong answer in uva why is it so??
why? why??

#include<cstdio>
int main()
{
long long int t,a,b,p,reverse,reverse1,reverse2;
scanf("%lld",&t);
while(t--)
{
reverse=0;
reverse1=0;
reverse2=0;
scanf("%lld%lld",&a,&b);
while(a!=0 ...
by pnkj_agrl
Sat May 10, 2014 10:14 pm
Forum: Volume 4 (400-499)
Topic: 494 - Kindergarten Counting Game
Replies: 119
Views: 37402

Re: why WA in 494?!!

why giving wrong answer for the last input pls help
here's my code
#include<cstdio>
#include<cstring>
int main()
{
char a[1000005];
int count,i,len;
while(gets(a))
{
len=strlen(a);
count=0;
for(i=0;i<=len;i++)
{

if(a[i]==' ')
count++;

}
printf("%d",count+1);
printf("\n ...

Go to advanced search