Advertisement
Guest User

Untitled

a guest
Dec 14th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. //============================================================================
  2. // Name        : HelloWorld.cpp
  3. // Author      : smalinux
  4. // Version     :
  5. // Copyright   : Your copyright notice
  6. // Description : Hello World in C++, Ansi-style
  7. //============================================================================
  8.  
  9. #include <iostream>
  10. #include <string>
  11. #include<iomanip>
  12. using namespace std;
  13.  
  14.  
  15.  
  16. int main() {
  17.     // ----------------------------------------------------------------------
  18.  
  19.     int N = 0;
  20.     int arr[1000];
  21.     cin >> N;
  22.     if(N >= 2 && N <= 1000) {
  23.         // - Insertion
  24.         for(int i = 0; i < N; i++) {
  25.             cin >> arr[i];
  26.             if(arr[i] >= -1e5 && arr[i] <= 1e5)
  27.                 continue;
  28.             else
  29.                 return -1;
  30.         }
  31.  
  32.         //
  33.         for(int i = 0; i < N; i++) {
  34.             if(arr[i] <= 10)
  35.                 cout << "A[" << i << "] = " << arr[i] << endl;
  36.         }
  37.     }
  38.  
  39.     // ----------------------------------------------------------------------
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement