Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- float a,b;
- namespace operacje
- {
- int dodaj(float a,float b)
- {
- return (a+b);
- }
- int odejmij(float a,float b)
- {
- return (a-b);
- }
- int pomnoz(float a,float b)
- {
- return (a*b);
- }
- int podziel(float a,float b)
- {
- return (a/b);
- }
- int reszta(int a,int b)
- {
- return (a%b);
- }
- }
- void pobierz()
- {
- cout<<"Podaj a i b"<<endl;
- cin>>a;
- cin>>b;
- }
- using namespace operacje;
- void dzialania()
- {
- cout<<"Dodawanie ";
- cout<<dodaj(a,b)<<endl;
- cout<<"Odejmowanie ";
- cout<<odejmij(a,b)<<endl;
- cout<<"Mnozenie ";
- cout<<pomnoz(a,b)<<endl;
- cout<<"Dzielenie calkowite ";
- cout<<podziel(a,b)<<endl;
- cout<<"Reszta z dzielenia ";
- cout<<reszta(a,b)<<endl;
- }
- int main()
- {
- pobierz();
- dzialania();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement