Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #include <windows.h>
  5.  
  6.  
  7. int main()
  8. {
  9.  
  10.  
  11. srand(time(0));
  12.  
  13. int comp = 0;
  14. int user = 0;
  15. comp = rand()%101;
  16. int c;
  17. c = 0;
  18. while(1)
  19. {
  20. printf("vvedite chislo ot 0-100 : ");
  21. scanf("%d", &user);
  22. if(comp<user)
  23. {
  24. printf("slishkom mnogo \n");
  25. }
  26. else if(comp>user)
  27. {
  28. printf("slishkom malo \n");
  29. }
  30. else if(comp==user)
  31. {
  32. printf("vy ugadali \n");
  33. break;
  34. } c++;
  35.  
  36.  
  37.  
  38.  
  39. } printf("vashi popytki %d", c);
  40.  
  41.  
  42.  
  43.  
  44.  
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement