T: Write a guess number game
#include <stdio.h> #include <stdlib.h> #include <time.h>int main () {int I;int Random=0;srand (( unsigned) time (NULL)), Random=rand ()%100;while (1) {printf ("Please input a number:\n"); scanf ("%d\n", I); if (I>rand ()) printf ("Too large!\n"); else if (I<rand ()) printf ("Too small!\n"); else printf ("You are right! %d\n ", Rand ());} return 0;}
Content: You want a number, I based on your instructions (guess big, guess small) guess, what you think.
Sentiment: believe that almost everyone's mobile phone is more or less a few game apps, do not know if you will also like me, think that writing these games behind the programmer 6, his life estimates only look. If, there is a teacher or the boss to give us a task of writing a game, I think my heart must be saying: "I still choose to die!" My heart hurts so bad ... "
After this, programming is not so difficult, thinking right, solid language Foundation, you can do! Speak with the facts. Look, a rookie like me wrote, a few lines of code just, start to believe it!
Small program, great fun!
This article is from the "sunshine225" blog, make sure to keep this source http://10707460.blog.51cto.com/10697460/1752703
Write a simple game in C