Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main(int argc, char** argv) {
- int przychody;
- int suma;
- int srednia;
- int min=0,max=0;
- for(int i=1;i<=12;i++)
- {
- cout<<"Podaj przychody ";
- cin>>przychody;
- cout<<"Dochod z miesiaca"<<" "<<i<<" "<<"wynosi"<<" "<<przychody<<endl;
- suma+=przychody++;
- srednia=przychody % 12;
- if(przychody<0){
- min=przychody;
- max=przychody;
- }
- if(przychody>max) max=przychody;
- if(przychody<min) min=przychody;
- }
- cout<<"Maksymalny dochod "<<max<<endl;
- cout<<"Minimalny dochod "<<min<<endl;
- cout<<"Suma dochodu "<<" "<<suma<<endl;
- cout<<"Srednia dochodu "<<" "<<srednia<<endl;
- system ("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement