From Speedy Pudu, 3 Months ago, written in Plain Text.
This paste is a reply to Untitled from Toxic Stork - view diff
Embed
Hits: 74
1. #include <iostream>
2. #include <fstream>
3. int trojkat(int a, int h)
4. {
5.         int d;
6.         d=(a*h)/2;
7.         return d;
8. }
9. int kwadrat(int a)
10. {
11. int d;
12. d=a*a;
13. return d;
14. }
15. int prostokat(int a, int b){
16. int d;
17. d=a*b;
18. return d;
19. }
20. int rownoleglobok(int a, int h)
21. {
22. int d;
23. d=a*h;
24. return d;
25. }
26. int trapez(int a, int b,int h){
27.
28. int d;
29. d=a+b/2*h;
30. return d;
31. }
32. using namespace std;
33. int main(){
34. int wybor,b ,a,h;
35. cout<<"1 trojkat,2 kwadrat,3 prostokat,4 rownoleglobok,5 trapez"<<endl;
36. cin>>wybor;
37. switch(wybor)
38.
39. {
40. case 1:
41.         cout<<"podaj a:";
42.         cin>>a;
43.         cout<<"podaj h:";
44.         cin>>h;
45.   cout<<"pole trojkatu="<<trojkat(a,h)<<endl;
46.     break;
47.
48. case 2:
49.  cout<<"podaj a:";
50.  cin>>a;
52.     break;
53.
54.
55. case 3:
56.   cout<<"podaj a";
57.   cin>>a;
58.   cout<<"podaj b";
59.   cin>>b;
60.   cout<<"pole prostokatu"<<prostokat(a,b)<<endl;
61.     break;
62.
63.
64. case 4:
65.         cout<<"podaj a";
66.         cin>>a;
67.         cout<<"podaj h";
68.         cin>>h;
69.         cout<<"pole rownolegloboku="<<rownoleglobok(a,h)<<endl;
70.
71.     break;
72. case 5:
73.         cout<<"podaj a";
74.         cin>>a;
75.         cout<<"podaj b";
76.         cin>>b;
77.         cout<<"podaj h";
78.         cin>>h;
79.         cout<<"pole trapezu="<<trapez(a,b,h)<<endl;
80.
81.   break;
82.
83.
84. }
85.
86. return 0;
87. }

# Replies to Re: Untitled

Title Name Language When
Re: Re: Untitled Big Treeshrew text 3 Months ago.