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

诚心请教>_<

Posted by lh0823 at 2006-07-31 01:36:13 on Problem 2328
我错了,我又错了......

#include<iostream>
#include<string>
using namespace std;
int main()
{
 int n[100],k;
 while(cin>>n[0])
 {
  k=cin.get();
  if(!n[0])return 0;
  char m[100][10]={'\0'},a[9]="right on",b[9]="too high",c[8]="too low";
  int i(1),j,z(0);
  cin.getline(m[0],10);
  if(!strcmp(m[0],a))cout<<"Stan may be honest";else{
  while(i<100)
  {
  cin>>n[i];k=cin.get();
  cin.getline(m[i],10);
  if(!strcmp(m[i],a))break;
  i++;
  }
 for(j=0;j<i;j++)
 {
  if(!strcmp(m[j],b))
  {
   if(n[j]>n[i])z++;
   else cout<<"Stan is dishonest"<<endl;
  }
  if(!strcmp(m[j],c))
  {
   if(n[j]<n[i])z++;
   else cout<<"Stan is dishonest"<<endl;
  }
  if(z==i)cout<<"Stan may be honest"<<endl;
  }}
 memset(n,0,100);}
 return 0;
}

帮个忙吧

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