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 |
为什么是wrong anser?是不是我理解错题意了?总感觉没那么简单。。#include <stdio.h> void main() { int a[6]; int num=0; long int sum; scanf("%d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5]); while(a[0]!=0||a[1]!=0||a[2]!=0||a[3]!=0||a[4]!=0||a[5]!=0) { sum=1*1*a[0]+2*2*a[1]+3*3*a[2]+4*4*a[3]+5*5*a[4]+6*6*a[5]; if(sum%(6*6)==0) num=sum/(6*6); else if(sum/36.0>1) num=sum/(6*6)+1; else if(sum/(6*6)<1) num=1; printf("%d\n",num); sum=0; scanf("%d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5]); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator