Robert_JR

Int

Oct 18th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. //#include <algorithm>
  4. //#include <cmath>
  5. //#include <ctime>
  6. //#include <string>
  7. //#include <cstdlib>
  8. //#define ll long long int
  9. //#define TESTCASE int t;scanf("%d", &t);for(int i = 0; i < t; i++)
  10. //#define PF printf
  11. //#define SF scanf
  12. #define STDIN freopen("in.txt", "rt" , stdin);
  13. //#define STDOUT freopen("out.txt", "wt", stdout);
  14.  
  15. using namespace std;
  16.  
  17. int array[10000000];
  18.  
  19. int main()
  20. {
  21.     int numberToSearch = -5, n = 100;
  22.     //cin >> numberToSearch;
  23.  
  24.     STDIN
  25.  
  26.     int num, index = 0;
  27.     bool flag = false;
  28.  
  29.     while(cin >> num)
  30.         array[index++] = num;
  31.  
  32.     //int start_time = clock();
  33.  
  34.     for(int i = 0; i < n; i++)
  35.     {
  36.         if(array[i] == numberToSearch)
  37.         {
  38.             flag = true;
  39.             break;
  40.         }
  41.     }
  42.  
  43.     //int end_time = clock();
  44.  
  45.     if(flag) cout << "Found" << endl;
  46.     else cout << "Not Found" << endl;
  47.  
  48.     return 0;
  49. }
Add Comment
Please, Sign In to add comment