Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main(){
- float type1,type,a,b,c,P,H,R,V,S;
- P=3.14;
- cout<<"1 shar"<<endl<<"2 kvadrat"<<endl;
- cin>>type1;
- if (type1==1){
- cin>>type;
- if (type==1){
- cin>>R;
- float k = 4/3;
- V=k*P*R*R*R;
- cout<<"V = "<<V<<endl;
- }
- if (type==2){
- cin>>R;
- S=4*P*R*R;
- cout<<"S = "<<S<<endl;
- }
- if (type==3){
- cin>>R;
- S=P*R*R;
- cout<<"S = "<<S<<endl;
- }
- }
- if (type1==2){
- if(type==1){
- cin>>a>>b>>c;
- V=a*b*c;
- cout<<"V = "<<V<<endl;
- }
- if (type==2){
- cin>>a>>b>>c;
- S=2*(a*b)+2*(a*c)+2*(b*c);
- cout<<"S = "<<S<<endl;
- }
- }
- }
Add Comment
Please, Sign In to add comment