1 #include<iostream> 2 #include<vector> 3 using namespace std; 4 class Array{ 5 vector<int> arr; 6 public: 7 int operator[](int n){return arr[n];} 8 int size() 9 { 10 return arr.size(); 11 } 12 13 void get(int n) 14 { 15 arr.clear(); 16 int tmp; 17 for(int i=0;i<n;i++) 18 { 19 cin>>tmp; 20 arr.push_back(tmp); 21 } 22 } 23 }; 24 int main() 25 { 26 int cases; 27 Array arr; 28 cin >> cases; 29 for(int ca = 1; ca <= cases; ca++) 30 { 31 int len; 32 cin >> len; 33 arr.get(len); 34 for(int i = 0; i < arr.size(); i++) 35 if(i + 1 == arr.size()) 36 cout << arr[i]; 37 else 38 cout << arr[i] << " "; 39 cout << endl; 40 } 41 } 42 #include<iostream> 43 #include<vector> 44 using namespace std; 45 class Array{ 46 vector<int> arr; 47 public: 48 int operator[](int n){return arr[n];} 49 int size() 50 { 51 return arr.size(); 52 } 53 54 void get(int n) 55 { 56 arr.clear(); 57 int tmp; 58 for(int i=0;i<n;i++) 59 { 60 cin>>tmp; 61 arr.push_back(tmp); 62 } 63 } 64 }; 65 int main() 66 { 67 int cases; 68 Array arr; 69 cin >> cases; 70 for(int ca = 1; ca <= cases; ca++) 71 { 72 int len; 73 cin >> len; 74 arr.get(len); 75 for(int i = 0; i < arr.size(); i++) 76 if(i + 1 == arr.size()) 77 cout << arr[i]; 78 else 79 cout << arr[i] << " "; 80 cout << endl; 81 } 82 }