设计一个简单的猜数游戏?

设计一个简单的猜数游戏:先由计算机“想”一个数请用户猜,如果用户猜对了,则计算机给出提示信息“Right”,否则提示“Wrong”,并告诉用户是大还是小。

qq_慕标9233296
浏览 1165回答 2
2回答

慕设计2395807

RFFXFJGRWDYXEMOBCDRNBYNOZQFYYMQESJJDOBVNOLQKEOVQUIYIPDOGGQMQAGABFZISJMAUVZWARRRONUISRLTQZPQBLNMGHOALSGRWTUHIWNLVZABPNVEZNAXEDHXOPPURYYPTTUFUBZNWNDFCSGELSAJQUROZHZFGKYZFXIBZDKYBYOIZNEIKRCWVSMHOFQFBPXZDSTQMQAAEWXXUTAOWWJXDPPRFSGBTUIVIYVRUFCJSNQLSJDUQKBIMNAKEOCOEGDBCJGVHFCZQHRLJTGJVTXBISNKARJDIZQUSXCSSTPKPPGBRURTWNHVSMMTOBBWQKMQGGHTDMQDXRSIWLKHQNABZZGAEIHHWEYHFLZPLFVVZMGGGHCCWMGFFVMGAKNXJKRBLCJTDQQCWNNEEIZZNNYSRVNKAEFUVPWMGWKHBHLOBCFPPCWXLJPGQNXKXBVGCGPGKEAQHYLQJTTARTNOEVQCWXUCSZTDEHHACZWWXEFFEDDELVKXQQKHBZJNHLLSMOWOYZGXHVVGWWWQPFJPPAEKPFSWLBFSSWTVLZZWKTAUELPGGQNHWGAUORMWAXXHZDHYSWHSPSPDDXUZJCMACARRLIDJJOVFPNHLIIRGRECYLMJNJZNXEMZGWMDCWMJGAXUZAHFELGDKXWGKRYYEFBCQWNOORLESCXELVFSADUIVKAFMAXCJJTAVCFQKQWZZTGKHPWGQXRXNURKHOIOVVWTPVXKLVCWMMDTXUULQNWWMWNKRULPXDQKZMZQOOCFTMNRQTNNOISBEVSWRLMJVSCSPJJOTJNKXJKDJLLIFSZTLIPZHNXRPMGNAQRQHEHBOBEFIYJMWELRHDUYZEFOSLISWZGGYYOBLRRXJUOXEZNWTD

a2596446032

#include<stdio.h>#include<stdlib.h>#include<time.h>int main(){    srand((unsigned)time(NULL));    int number=rand();    int guessNumber;    do    {    printf("Your number is ");    scanf("%d",&guessNumber);    if(number!=guessNumber)    {        printf("Wrong\n");        if(guessNumber>number)        {            printf("Bigger than my number\n");        }        else if(guessNumber<number)        {            printf("Less than my number\n");        }    }    else    {        printf("Right");    }} while (number!=guessNumber);system("pause");return 0;}
打开App,查看更多内容
随时随地看视频慕课网APP