Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main() {
- long n = 0;
- long sum = 0;
- while(true){
- cout << "Bitte geben Sie einige ganze Zahlen ein: ";
- while (cin >> n) {
- sum = sum + n;
- }
- cout << "\nDas Ergebnis lautet: " << sum << endl << endl;
- cout << "Wollen Sie den Ablauf wiederholen (j/n) ";
- char c;
- cin >> c;
- if (c == 'n')
- break;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement