第四章5

#include<stdio.h>
int main(void)
{
    int mynumber=38;
    int count=0,yournumber;
    for(count=1;count<=5;count++){
        printf("Input your number:");
        scanf("%d",&yournumber);
        if(yournumber==mynumber){
            printf("OK!you are right!\n");
            break;
        }
        else
            if(yournumber>mynumber)
                printf("Sorry!yournumber is bigger than mynumber!\n");
            else
                printf("Sorry!yournumber is smaller than mynumber!\n");
    }
    printf("Game is over!\n");
    return 0;
}

posted @ 2013-10-05 15:44  执于一念  阅读(142)  评论(0编辑  收藏  举报