markdown 在线制作ppt json校验和格式化工具

POJ 2328

#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;

int main()
{
    //freopen("acm.acm","r",stdin);
    int min;
    int max;
    int tem;
    string s1;
    string s;
    while(1)
    {
        max = 11;
        min = -1;
        
        while(cin>>tem)
        {
            getline(cin,s1);
            getline(cin,s);
            //cout<<s<<endl;
            //cout<<":--------"<<endl;
            if(tem == 0)
                return 0;
            if(s == "too high")
            {
                if(tem < max)
                    max = tem;
            }
            else if(s == "too low")
            {
                if(tem > min)
                    min = tem;
            }
            else if(s == "right on")
            {
                if(tem < max && tem > min)
                {
                    cout<<"Stan may be honest"<<endl;
                    break;
                }
                else
                {
                    cout<<"Stan is dishonest"<<endl;
                    break;
                //    cout<<"00000000000"<<endl;
                }
            }

        }
    }
}

 

posted @ 2015-06-11 10:47  GavinHacker  阅读(105)  评论(0编辑  收藏  举报
markdown 在线制作ppt json校验和格式化工具