Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "rus");
- int n, s = 0,i=1;
- do
- {
- cout<<"a["<<i<<"] -> ";
- cin>>n;
- if (n!=0)
- s += n;
- i++;
- } while (n!=0);
- cout<<"SUM : "<<s<<'\n';
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement