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 speedcell4 at 2011-02-07 18:53:28 on Problem 2328
#include<stdio.h>
#include<string.h>
int n;
char a[10];
void kan(int n,char a[],int b[])
{
    if(strcmp("too high",a)==0) for(int i=n;11-i;i++)     b[i]=1;
    if(strcmp("too low",a)==0)  for(int i=n;i;i--)        b[i]=1;
}
int main()
{
    while(scanf("%d",&n),n)
    {
        int b[11]={0};
        while(gets(a),strcmp("right on",a))
        {
            kan(n,a,b);
            scanf("%d",&n);
        }
        if(b[n]==0) printf("Stan may be honest\n");
        else printf("Stan is dishonest\n");
    }
}

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