C language implementation, guess digital intelligence games
# Define _ CRT_SECURE_NO_WARNINGS # include <stdio. h> # include <stdlib. h> # include <time. h> int main () {printf ("welcome to the guess digital game! \ N "); printf (" \ n "); printf ("************************ \ n"); printf ("\ n "); printf ("********** 1-<start ******** \ n "); printf ("********* 0-<exit ******** \ n"); printf ("\ n "); printf ("************************* \ n"); int input = 1; while (input) {printf ("select->:"); scanf ("% d", & input); switch (input) {case 1: {int n; int m; srand (unsigned int) time (NULL); n = rand () % 101; while (1) {printf ("enter a number between 0 and: "); Scanf ("% d", & m); if (m> n) {printf ("you guess it's big! \ N ");} else if (m <n) {printf (" You guessed it! \ N ");} else {printf (" You guessed it! \ N "); break ;}}default: {printf (" game exited! \ N "); break ;}}system (" pause "); return 0 ;}