Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3. #include <cstdlib>
  4. #include <ctime>
  5. #include <algorithm>
  6. #define N 10
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.     int tab[N];
  13.     srand(time(NULL));
  14.     for (int i = 0; i < N; i++)
  15.     {
  16.         tab[i] = rand() % 100 + 1;
  17.         cout << tab[i]<<" ";
  18.     }
  19.     int Min;
  20.     cin >> Min;
  21.  
  22.     for (int i = 0; i < N; i++)
  23.     {
  24.         if (Min == tab[i])
  25.         {
  26.             cout << "Tak" << endl;
  27.             return 0;
  28.         }
  29.     }
  30.     cout << "Nie" << endl;
  31.  
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement