| ||||||||||
| 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:郁闷啊!为什么scanf就对而cin就错?附程序In Reply To:郁闷啊!为什么scanf就对而cin就错?附程序 Posted by:jdw_js at 2005-11-05 22:00:15 > #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";
> }
> }
表告我你用g++提交的这个程序
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator