Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:郁闷啊!为什么scanf就对而cin就错?附程序

Posted by magang at 2005-11-08 12:39:01 on Problem 2664
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator