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 |
郁闷啊!为什么scanf就对而cin就错?附程序#include <stdio.h> #include <stdlib.h> #include <iostream.h> int main() { int k,m; int i,j,t,s,c,min; char f[10000],ok; while(cin>>k && k) { for(i=0;i<10000;i++) f[i]=0; // scanf("%d",&m); cin>>m; for(i=0;i<k;++i) { // scanf("%d",&t); cin>>t; f[t]=1; } ok=1; for(j=0;j<m;++j) { //scanf("%d%d",&c,&min); cin>>c>>min; for(s=0,i=0;i<c;++i) { //scanf("%d",&t); cin>>t; s+=f[t]; } if(s<min) ok=0; } if(ok) cout<<"yes\n"; else cout<<"no\n"; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator