Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- main(){
- int a=0,b=0,dod=0,uje=0,zBylF=0;
- cout<<"Podaj a: ";cin >> a;
- cout<<"\nPodaj b: ";cin >> b;
- if(a>b) swap(a,b);
- cout<<"Liczby z przedzialu "<<a<<" - "<<b<<": ";
- for(int x=a;x<=b;x++){
- if(x==0) zBylF=1;
- if(x>0) dod++;
- if(0>x) uje++;
- cout<<x;
- if(x!=b) cout<<", ";
- }
- cout<<"\nLiczb dodatnich: "<<dod;
- cout<<"\nLiczb ujemnych: "<<uje;
- if(zBylF==0) cout<<"\nZero wystapilo";else cout<<"\nZero nie wystapilo\n";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment