Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- //Unos broja brojeva te nakon toga nakon svakog unosa ispisuje sumu i broj negativnih do tad
- int brojUnosa=0;
- int unesenBroj=0;
- int suma=0;
- int brojNegativnih=0;
- cout<<"Unesi broj unosa: "<<endl;
- cin>>brojUnosa;
- for(int brojac=0; brojac<brojUnosa;brojac++){
- cout<<"Unesite broj: "<<endl;
- cin>>unesenBroj;
- if(unesenBroj%2 !=0){
- brojNegativnih++;
- }
- suma+=unesenBroj;
- cout<<"Suma je: "<<suma<<endl;
- cout<<"Broj negativnih: "<<brojNegativnih<<endl;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement