Search found 4 matches

by Martuza_iu
Fri Oct 08, 2010 8:27 pm
Forum: Volume 105 (10500-10599)
Topic: 10591 - Happy Number
Replies: 61
Views: 31041

Re: 10591 - Happy Number

Why get WA pls help me ......... #include<stdio.h>
#define max 10000
long unhappy(long n);
long search(long t[max],long s,long c);
long m,c,t[max],j;
main()
{
long x;
scanf("%ld",&x);
for(j=1;j<=x;j++)
{
scanf("%ld",&m);
c=1;
unhappy(m);
}
return 0;
}
long unhappy(long n)
{
long p,q,sum ...
by Martuza_iu
Fri Sep 24, 2010 8:32 pm
Forum: Volume 103 (10300-10399)
Topic: 10347 - Medians
Replies: 32
Views: 17987

Re: 10347 - Medians

pls help me i got WA. #include<stdio.h>
#include<math.h>
int main()
{
double area,m1,m2,m3,l,s,p;
while(scanf("%lf%lf%lf",&m1,&m2,&m3)!=EOF)
{
s=(m1+m2+m3)/2;
l=s*(s-m1)*(s-m2)*(s-m3);
p=sqrt(l);
area=(4*p)/3;
if(m1==0||m2==0||m3==0||area<=0)
printf("-1.000\n");
else
printf("%.3lf\n",area ...
by Martuza_iu
Fri Sep 24, 2010 8:21 pm
Forum: Volume 100 (10000-10099)
Topic: 10018 - Reverse and Add
Replies: 169
Views: 43953

Re: 10018 TE why?

Why I get time limit exit? pls help me. #include<stdio.h>
int main()
{
long long int nm,rm[10000]={0},i,c,rv,b,d,j,m;
scanf("%ll",&m);
for(j=0;j<m;j++)
{
scanf("%ll",&nm);
d=-1;
b=0;
while(b!=rv)
{
d=d+1;
b=nm;
c=0;
for(i=0;nm!=0;i++)
{
rm[i]=nm%10;
nm=nm/10;
c=c+1;
}
rv=0;
for(i ...
by Martuza_iu
Wed Sep 22, 2010 7:11 pm
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 101941

Re: 10035 - primary arithmetic

Please help me. My program is not give right ans.[code#include<stdio.h>
int main()
{
long int n,m,a[100]={0},b[100]={0},i,h,c,d,t,r,k,l=1;
while(scanf("%ld%ld",&n,&m)!=EOF)
{
if(n==0&&m==0)
break;
c=0;
for(i=0;n!=0;i++)
{
a =n%10;
n=n/10;
c=c+1;
}
d=0;
for(i=0;m!=0;i++)
{
b =m%10;
m ...

Go to advanced search