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 |
调试没问题 为什么WA啊#include<stdio.h> void main() { int num(int a,int b,int c,int d,int e,int f); int a[10][6],i,j,s[10]; for(i=0;i<10;i++) {for(j=0;j<6;j++)scanf("%d",&a[i][j]); if(a[i][0]==0&&a[i][1]==0&&a[i][2]==0&&a[i][3]==0&&a[i][4]==0&&a[i][5]==0) break; } for(i=0;i<10;i++) {s[i]=num(a[i][0],a[i][1],a[i][2],a[i][3],a[i][4],a[i][5]); if(s[i]==0)break; printf("%d\n",s[i]); } } int num(int a,int b,int c,int d,int e,int f) {int x,y,z,i; int u[4]={0,5,3,1}; int t[4]={0,7,6,5}; {z=f+e+d+(c+3)/4; y=5*d+u[c%4]; x=11*e+t[c%4]; if(y<b){ i=(b-y+8)/9; z+=i; x+=4*(9*i-(b-y)); } else x+=4*(y-b); if(x<a)z+=(a-x+35)/36; return(z); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator