1string z,s;
2 while (true)
3 {
4 cin>>z;
5 s+=z;
6 if(cin.peek()=='\n')
7 break;
8 }
9................................
10 OR\/
11.................................
12string s;
13getline(cin,s);
1int main() {
2int sum = 0;
3cout << "enter number" << endl;
4int i = 0;
5while (true) {
6 cin >> i;
7 sum += i;
8 //cout << i << endl;
9 if (cin.peek() == '\n') {
10 break;
11 }
12
13}
14
15cout << "result: " << sum << endl;
16return 0;
17}
18
1int i, n, arr[100];
2
3scanf("%d", &n);
4for (i = 0; i < n; ++i)
5 scanf("%d", &arr[i]);
6