dllbridge

Untitled

Apr 15th, 2026
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.92 KB | None | 0 0
  1.  
  2. #define _CRT_SECURE_NO_WARNINGS
  3.  
  4. #include  <cstdio>
  5. #include  <time.h>
  6. #include<stdlib.h>
  7. #include <clocale>
  8.  
  9. int n_1, n_2;
  10.  
  11.  
  12. ///////////////////////////////////////////////////
  13. int main()
  14. {
  15.    
  16.     setlocale  (0, "");
  17.     srand(    time(0));
  18.     n_1 = rand() % 101;
  19.    
  20.     printf("Введите число которое загадала ( %d ) от 0 до 100: ", n_1);  scanf("%d", &n_2);
  21.     printf("Загаданное число: %d \n", n_1);
  22.     printf("Отгаданное число: %d \n", n_2);
  23.    
  24. L_01:  
  25.     if (n_2 == n_1)
  26.     {
  27.         printf("Угадал!!\n");
  28.         return 0;
  29.     }
  30.    
  31.    
  32.     if (n_2 - n_1 > 25||n_1 - n_2 > 25)
  33.     {
  34.         printf("Cильно ошибся\n");  
  35.         printf("Ещё попробуйте угадать: "); scanf("%d", &n_2);
  36.         goto L_01;
  37.     }
  38.     if (n_2 - n_1 > 12||n_1 - n_2 > 12)   printf("Средне ошибся\n");
  39.     else
  40.     {
  41.         printf("Не сильно ошибся\n");
  42.     }
  43.    
  44. return 0;  
  45. }
  46.  
  47.  
Advertisement
Add Comment
Please, Sign In to add comment