| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:Help me.thanks.In Reply To:Help me.thanks. Posted by:kuangwenkui at 2007-06-16 16:30:42 > #include<stdio.h>
> main()
> {float a,sum[100],p,q,s=0;
> int i,j,k,n,m;
> for(k=1;k<100 ;k++)
> {printf("sample input #%d\n",k);
> scanf("%d %d",&n,&m);
> for(i=1;i<n;i++)
> { sum[i]=1;
> for(j=1;j<m+n;j++)
> { p=(float)(i/n);
> q=(float)(j/(m+n));printf("%f %f",p,q);
> if( p>q)
> a=p-q;
> else a=q-p;
> if(sum[i]>a)
> sum[i]=a;
> else continue;
> }
> s=sum[i]+s;
> }
> s=s*10000;
> printf("sample output #%d\n%.4f\n",k,s);
> }
> }
No "sample input" or "sample output" needed in the printf function!
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator