Advertisement
Josif_tepe

Untitled

Oct 6th, 2021
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <algorithm>
  4. #include <vector>
  5. using namespace std;
  6.  
  7. int niza[100];
  8. int n;
  9. void input(int i) {
  10.     if(i == n) {
  11.         return;
  12.     }
  13.     cin >> niza[i];
  14.     input(i + 1);
  15. }
  16. int main() {
  17.     cin >> n;
  18.     input(0);
  19.    
  20.     for(int i = 0; i < n; i++) {
  21.         cout << niza[i] << " ";
  22.     }
  23.     return 0;
  24. }
  25. // print(1) : cout << 1 << endl;
  26. // print(2) : cout << 2 << endl;
  27. // print(3) : cout << 3 << endl;
  28. // print(4) : cout << 4 << endl;
  29. // print(5) : cout << 5 << endl;
  30. // print(6)
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement