Search found 10 matches

by mrmrumman
Sat Sep 06, 2008 3:26 pm
Forum: Volume 4 (400-499)
Topic: 490 - Rotating Sentences
Replies: 212
Views: 48074

Re: 490 : why WA with this simple looking problem?

I am getting WA anyone can help?



#include <stdio.h>
# include <string.h>
int main()
{
char input[105][105];
int num=0,max=0;


while(gets(input[num]))
{
if(max<strlen(input[num]))
max=strlen(input[num]);
}
for(int i=0;i<max;i++)
{
if(i>0)
printf("\n");
for(int j=num;j>=0;j ...
by mrmrumman
Wed Sep 03, 2008 4:12 am
Forum: Volume 1 (100-199)
Topic: 119 - Greedy Gift Givers
Replies: 145
Views: 47383

Re: 119 Why WA??

I am getting WA can you please help?

# include <stdio.h>
# include <string.h>
int main()
{
int number;
int personnum1=10;
int nameChar=12;
char name[personnum1][nameChar];
int counter=1;
while(scanf("%d",&number)==1)
{
if(counter>1)
printf("\n");
int serial=number;
int credit=0,gift=0 ...
by mrmrumman
Wed Sep 03, 2008 2:30 am
Forum: Volume 1 (100-199)
Topic: 119 - Greedy Gift Givers
Replies: 145
Views: 47383

Re: Compile Error

Please see my code for UVA 119 problem it's show me floating point error why?
Any way can anyone tell what is the best free C++ compiler for VISTA and UBUNTU.

# include <stdio.h>
# include <string.h>
int main()
{
int number;
int personnum1=10;
int nameChar=12;
char name[personnum1][nameChar ...
by mrmrumman
Thu Jul 10, 2008 10:52 am
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 64382

Why WA in 488

What is the problem with code any problem with my code? Is the way I taking input is right? Please help...


# include <stdio.h>
int main()
{
int cases,i,height,frequency,j;

scanf("%d",&cases);
for(i=0;i<cases;i++)
{
scanf("%d",&height);
scanf("%d",&frequency);
for(int l=0;l<frequency;l ...
by mrmrumman
Thu Jul 10, 2008 10:39 am
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 64382

Re: WA 488

any1 can help why I get WA?

# include <stdio.h>
int main()
{
int cases,i,height,frequency,j;

scanf("%d",&cases);
for(i=0;i<cases;i++)
{
scanf("%d",&height);
scanf("%d",&frequency);
for(int l=0;l<frequency;l++)
{
if(l!=0)
printf("\n");
printf("\n");
for(j=1;j<=height;j++)
{
for(int ...
by mrmrumman
Wed Jul 09, 2008 10:08 pm
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 64382

Re: WA 488

Why I get wrong anser with my code what is the solution?


[b]# include <stdio.h>
int main()
{
int cases,i,height,frequency,j;
char line;
while(scanf("%d",&cases)==1)
{
for(i=0;i<cases;i++)
{
scanf("%d",&height);
scanf("%d",&frequency);
for(int l=0;l<frequency;l++)
{
if(l!=0)
printf("\n ...
by mrmrumman
Mon Jul 07, 2008 10:05 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317936

Re: 100

Thanks Opu bhaiya and mf my solution has been accepted. :D
by mrmrumman
Sun Jul 06, 2008 8:25 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317936

Volume 100 with WA message

# include <stdio.h>

int main()
{

int i=0, max;
int one, two;
while(scanf("%d %d",&one,&two)==2)
{
int j=one;
int k=j,max=0;
while(j<=two)
{
one=j;
i=0;
while(one!=1)
{
if(one%2==0)
{
one=one/2;
i++;
}
else if(one%2==1)
{
one=3*one+1;
i++;
}
}
i++;/*for one=1*/
if(max>i ...
by mrmrumman
Sat Jul 05, 2008 11:49 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317936

I am facing a problem

My code is like this:

# include <stdio.h>

int main()
{

int i=0,one, two, max=0;
scanf("%d %d",&one,&two);
int j=one;
while(j<=two)
{
one=j;
i=0;
while(one!=1)
{
if(one%2==0)
{
one=one/2;
i++;
}
else if(one%2==1)
{
one=3*one+1;
i++;
}
}
i++;/*for one=1*/
if(max>i)
max=max ...
by mrmrumman
Sat Jul 05, 2008 11:36 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317936

Why my code is not working

My code is like this:


# include <stdio.h>

int main()
{

int i=0,one, two, max=0;
scanf("%d %d",&one,&two);
int j=one;
while(j<=two)
{
one=j;
i=0;
while(one!=1)
{
if(one%2==0)
{
one=one/2;
i++;
}
else if(one%2==1)
{
one=3*one+1;
i++;
}
}
i++;/*for one=1*/
if(max>i)
max=max ...

Go to advanced search