Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5.  
  6. double przekatna(int a, int b)
  7. {
  8. return(sqrt((a*a)+(b*b)));
  9. }
  10. int obwod(int a, int b)
  11. {
  12. return((2*a)+(2*b));
  13. }
  14. void autor()
  15. {
  16. setlocale(LC_ALL,"");
  17. cout<<"Olaf Dębski";
  18. }
  19. int pole(int a,int b)
  20. {
  21. return(a*b);
  22. }
  23.  
  24. int main()
  25. {
  26. int x, y;
  27.  
  28. do
  29. {
  30. cout << "Podaj 1sza liczbe dodatnia w zakresie od 1 do 20: ";
  31. cin>>x;
  32. }
  33. while((x<0)||(x>=20));
  34.  
  35. do
  36. {
  37. cout<<"Podaj 2ga liczbe dodatnia w zakresie od 1 do 20: ";
  38. cin>>y;
  39. }
  40. while((y<0)||(y>=20));
  41.  
  42. cout<<"Dla A=:"<<x<<" Dla B="<<y<<" Pole="<<pole(x,y)<<" OBWOD:"<<obwod(x,y)<<endl;
  43. cout<<"PRZEKATNA: "<<przekatna(x,y)<<endl;
  44.  
  45.  
  46. for(int i=0; i<x; i++)
  47. {
  48.  
  49. for(int i=0; i<y; i++)
  50. {
  51. cout<<"*";
  52. }
  53. cout<<endl;
  54. }
  55.  
  56. autor();
  57. return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement