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:求救!!!!!!!!In Reply To:求救!!!!!!!! Posted by:hdjt at 2006-12-22 10:06:50 > #include<stdio.h> > #define pr printf > int main() > { > int i,j,k,n,s,t,m,ip,p,q,count; > int sum[101];k=1; > while(1) > {for(i=1;i<=100;i++) > sum[i]=0; > count=0; > scanf("%d%d%d",&s,&t,&m);if(s+t+m==0) break; > for(i=0;i<s;i++) > {scanf("%d%d%d",&k,&p,&q); > sum[k]+=p+q; > count+=sum[k]; > } > pr("%d\n",count); > for(i=1;i<=t;i++) > { > scanf("%d%d",&j,&n); > if(sum[j]<3&&n>=m) {sum[j]++;count++;} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 条件有错 如果满足后面的条件最多只能加一个 > } > pr("Case %d: %d\n",k,count); > k++; > } > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator