Search found 6 matches

by This Is ERFAN
Tue Dec 16, 2014 9:31 pm
Forum: Volume 5 (500-599)
Topic: 579 - Clock Hands
Replies: 44
Views: 22745

Re: 579 - Clock Hands

Getting WA...plz help me out. :( #include<stdio.h>

int main()
{
float a,b;
char c;
while(scanf("%f %c %f",&a,&c,&b)==3)
{
if(a==0&&b==0) return 0;
float d,d1,d2,d3;
if(b==0)
{
if(a<=6) d=a*5*6;
else
d=(12-a)*5*6;
}
else
{
d1=b/2;
d2=b/5;
if(a==d2) d3=0;
else if(a>d2) d3=(a-d2)*5*6 ...
by This Is ERFAN
Sun Dec 14, 2014 2:17 am
Forum: Volume 101 (10100-10199)
Topic: 10110 - Light, more light
Replies: 76
Views: 40086

Re: 10110 - Light, more light

Why getting time limit...?? Check it out plz.. #include<stdio.h>

int main()
{
long long int a,i;
while(scanf("%lld",&a))
{
if(a==0) return 0;
long long int temp=a;
for(i=1;i<=a;i++)
{
if(a%i==0) temp=temp*(-1);
else continue;
}
if(temp<0) printf("yes\n");
else printf("no\n");
}
return ...
by This Is ERFAN
Tue Dec 09, 2014 12:14 am
Forum: Volume 5 (500-599)
Topic: 591 - Box of Bricks
Replies: 80
Views: 25235

Re: 591 Box of Bricks

Getting wrong answer....Help me plz #include<stdio.h>

int main()
{
int num,i,m,j,k;
for(m=1;; m++)
{
scanf("%d",&num);
if(num==0) return 0;
int arr[num];
for(i=0; i<num; i++)
{
scanf("%d",&arr[i]);
}
int sum=0;
for(j=0; j<num; j++)
{
sum=sum+arr[j];
}
int size=sum/num;
int count=0 ...
by This Is ERFAN
Sat Dec 06, 2014 10:33 pm
Forum: Volume 111 (11100-11199)
Topic: 11150 - Cola
Replies: 43
Views: 30548

Re: 11150 Cola

Getting time limit....help me plz #include<stdio.h>

int main()
{
int a;
while(1)
{
scanf("%d",&a);
int count=a,p,q=a,add;
while(q>=3)
{
add=q/3;
p=q%3;
q=add+p;
count=count+add;
}
if(q==2) count++;
printf("%d\n",count);
}
return 0;
}
by This Is ERFAN
Sat Dec 06, 2014 1:53 am
Forum: Volume 116 (11600-11699)
Topic: 11636 - Hello World!
Replies: 30
Views: 12648

Re: 11636 Hello world!

Why getting WA...??
plz help me out #include<stdio.h>

int main()
{
int test,i,a,j;
scanf("%d",&test);
for(i=1;i<=test;i++)
{
scanf("%d",&a);
int count=0,x=1;
for(j=0;x<a;j++)
{
x=x+x;
count++;

}
printf("Case %d: %d\n",i,count);

}
return 0;
}
by This Is ERFAN
Thu Dec 04, 2014 11:46 pm
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 102262

Re: 10035 - Primary Arithmetic

Why wrong answer..?

#include<stdio.h>

int main()
{
unsigned int a,b;

for(;;)
{
scanf("%u %u",&a,&b);
if(a==0&&b==0) return 0;
if(a<b)
{
int temp=a;
a=b;
b=temp;
}
int i,j,k,x[10],y[10],p;
for(i=0; a>0; i++)
{
p=a/10;
x[i]=a%10;
a=p;
}
for(j=0; b>0; j++)
{
p=b/10;
y[j]=b%10 ...

Go to advanced search