Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active September 3, 2019 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/2448bbf8a3123d014ee59f5feca2aaa1 to your computer and use it in GitHub Desktop.
Save parzibyte/2448bbf8a3123d014ee59f5feca2aaa1 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main() {
string entrada = "";
int sumatoria = 0, numero = 0;
while (true) {
cout << "Escribe un numero o '=' para ver la suma:\n";
cin >> entrada;
if (entrada == "=") break;
sumatoria += stoi(entrada);
}
cout << "La suma es " << sumatoria;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment