Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- void moja_funkcja()
- {
- cout<<"[1] dodawanie"<<endl;
- cout<<"[2] odejmowanie"<<endl;
- cout<<"[3] mnozenie"<<endl;
- cout<<"[4] dzielenie"<<endl;
- cout<<"[5] wyjscie z programu"<<endl;
- }
- void dodawanie()
- {
- int x, y;
- cin>>x>>y;
- cout<<"wynik "<<x+y<<endl;
- Sleep(1800);
- }
- void odejmowanie()
- {
- int x, y;
- cin>>x>>y;
- cout<<"wynik "<<x-y<<endl;
- Sleep(1800);
- }
- void mnozenie()
- {
- int x, y;
- cin>>x>>y;
- cout<<"wynik "<<x*y<<endl;
- Sleep(1800);
- }
- void dzielenie()
- {
- int x, y;
- cin>>x>>y;
- cout<<"wynik "<<x/y<<endl;
- Sleep(1800);
- }
- int main()
- {
- cout << "W programie sa nastepujaceopcje: " << endl;
- //moja_funkcja();
- int liczba, x, y;
- do
- {
- system("cls");
- moja_funkcja();
- cin>>liczba;
- // cout<<"podaj x i y";
- // cin>>x>>y;
- switch(liczba)
- {
- case 1:
- dodawanie();
- break;
- case 2:
- odejmowanie();
- break;
- case 3:
- mnozenie();
- break;
- case 4:
- dzielenie();
- break;
- default:
- break;
- }
- } while(liczba !=5);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement