Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int N, a;
- int sum = 0;
- cout << "Введите количество элементов " << " " << endl;
- cin >> N;
- cout << "Введите элементы " << " " << endl;
- for (int i = 0; i < N; i++)
- {
- cin >> a;
- sum = sum + a;
- }
- cout << "Сумма чисел равна" << " " << sum;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement