Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int a=0;
- int p=0;
- int b;
- int h;
- int main()
- {
- while (true)
- {
- cout<<"Inserisci la base :";
- cin>>b;
- cout<<endl<< "Inserisci l'altezza :";
- cin>>h;
- if(b==h)
- { cout<<endl<<"E' un quadrato : Si";
- a = b*b;
- p = b*4;
- }
- else
- {
- cout<<endl<<"E' un quadrato : No";
- a = (b*h);
- p = (b+h)*2;
- }
- cout<<endl<<"L'area e' : "<<a;
- cout<<endl<<"Il perimetro e' : "<<p;
- cout <<endl<<endl<<endl;
- system ("pause");
- system ("cls");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment