Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int main(int argc, char *argv[])
- {
- double x;
- double y;
- char darbiba;
- cout << "Ievadiet x"<<endl;
- cin >> x;
- cout << "Ievadiet y"<<endl;
- cin >> y;
- cout << "Kadu darbibu jus velaties veikt ar x un y"<<endl;
- cin >> darbiba;
- if (darbiba == '+') {cout<< x+y <<endl;}
- else if (darbiba == '-') {cout<< x-y <<endl;}
- else if (y==0) {cout<< "Ar nulli dalit/reizinat nedrikst" <<endl;}
- else if (darbiba == '*') {cout<< x*y <<endl;}
- else if (darbiba == '/') {cout<< x/y <<endl;}
- else cout << "nav";
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement