kilolilo

Untitled

Sep 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int main(){
  5. float type1,type,a,b,c,P,H,R,V,S;
  6. P=3.14;
  7. cout<<"1 shar"<<endl<<"2 kvadrat"<<endl;
  8. cin>>type1;
  9. if (type1==1){
  10. cin>>type;
  11. if (type==1){
  12. cin>>R;
  13. float k = 4/3;
  14. V=k*P*R*R*R;
  15. cout<<"V = "<<V<<endl;
  16. }
  17. if (type==2){
  18. cin>>R;
  19. S=4*P*R*R;
  20. cout<<"S = "<<S<<endl;
  21. }
  22. if (type==3){
  23. cin>>R;
  24. S=P*R*R;
  25. cout<<"S = "<<S<<endl;
  26. }
  27. }
  28. if (type1==2){
  29. cin>>type;
  30. if(type==1){
  31. cin>>a>>b>>c;
  32. V=a*b*c;
  33. cout<<"V = "<<V<<endl;
  34. }
  35. if (type==2){
  36. cin>>a>>b>>c;
  37. S=2*(a*b)+2*(a*c)+2*(b*c);
  38. cout<<"S = "<<S<<endl;
  39. }
  40. if (type==3){
  41. cin>>a>>b;
  42. S=a*b;
  43. cout<<"S = "<<S<<endl;
  44. }
  45.  
  46. }
  47. }
Add Comment
Please, Sign In to add comment