#include <stdio.h>
#include <stdlib.h>
int main()
{
int iRandomNum = 0;
int iResponse = 0;
iRandomNum = (rand() % 10) + 1;
printf("/nGuess a number between 1 and 10: ");
scanf("%d", &iResponse);
if (iResponse == iRandomNum)
printf("/nYou guessed right/n");
else {
printf("/nSorry, you guessed wrong/n");
printf("The correct guess was %d/n", iRandomNum);
}
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266765.html