Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <windows.h>
- int main()
- {
- srand(time(0));
- int comp = 0;
- int user = 0;
- comp = rand()%101;
- int c;
- c = 0;
- while(1)
- {
- printf("vvedite chislo ot 0-100 : ");
- scanf("%d", &user);
- if(comp<user)
- {
- printf("slishkom mnogo \n");
- }
- else if(comp>user)
- {
- printf("slishkom malo \n");
- }
- else if(comp==user)
- {
- printf("vy ugadali \n");
- break;
- } c++;
- } printf("vashi popytki %d", c);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement