Playground
#include <iostream> using namespace std; int main() { int n, s=0; while (true) { cout << "Vnesi broj (0 za kraj): "; cin >> n; if (n == 0) { cout << "Izleguvam od ciklusot." << endl; break; } //sobiraj gi broevite koi kje gi vnese korisnikot s += n; } cout << "Zbirot na broevite koi gi vnese e: " << s << endl; return 0; }
Input data
Program output
3 2 5 7 0
Execute
Language: ????????? | Memory: ???? KB | Time: ??? ms
Nothing has been executed, yet!