Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int brojac = 0;
- int zbir = 0;
- for(int n = 1; n <= 10; n++) {
- int broj;
- cin >> broj;
- if(broj < 0) {
- break;
- }
- brojac++;
- zbir += broj;
- }
- cout << zbir << endl;
- cout << brojac << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement