Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int x;
- int y;
- int wynik;
- int ILORAZ(int a, int b){
- if(b==0){
- return -1;
- }
- else if(a<0 || b<0){
- return -2;
- }
- else{
- wynik=a/b;
- }
- }
- int main()
- {
- cin>>x;
- cin>>y;
- if(ILORAZ(x, y)==-1){
- cout<<"Nie dziel przez 0";
- }
- else if (ILORAZ(x, y)==-2){
- cout<<"Jedna z liczb jest ujemna";
- }
- else{
- cout <<wynik;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment