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