Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- double przekatna(int a, int b)
- {
- return(sqrt((a*a)+(b*b)));
- }
- int obwod(int a, int b)
- {
- return((2*a)+(2*b));
- }
- void autor()
- {
- setlocale(LC_ALL,"");
- cout<<"Olaf Dębski";
- }
- int pole(int a,int b)
- {
- return(a*b);
- }
- int main()
- {
- int x, y;
- do
- {
- cout << "Podaj 1sza liczbe dodatnia w zakresie od 1 do 20: ";
- cin>>x;
- }
- while((x<0)||(x>=20));
- do
- {
- cout<<"Podaj 2ga liczbe dodatnia w zakresie od 1 do 20: ";
- cin>>y;
- }
- while((y<0)||(y>=20));
- cout<<"Dla A=:"<<x<<" Dla B="<<y<<" Pole="<<pole(x,y)<<" OBWOD:"<<obwod(x,y)<<endl;
- cout<<"PRZEKATNA: "<<przekatna(x,y)<<endl;
- for(int i=0; i<x; i++)
- {
- for(int i=0; i<y; i++)
- {
- cout<<"*";
- }
- cout<<endl;
- }
- autor();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement