Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream.h>
- #include <conio.h>
- int main()
- {int a, L[2], r[2], t[3];
- cout<<"Ce doriti sa calculati:\n";
- cout<<"1. Aria unui patrat;\n";
- cout<<"2. Aria unui cerc;\n";
- cout<<"3. Aria unui triunghi;\n";
- cout<<"Scrieti ce operatie doriti:";cin>>a;
- switch(a)
- {
- case 1:
- {
- cout<<"Scrieti lungimea laturii:";cin>>L[0];
- L[0] = L[0]*L[0];
- cout<<"Aria este:";cout<<L[1];
- }break;
- case 2:
- {
- cout<<"Scrieti valoarea lui r:";cin>>r[0];
- r[1] = 3.14*(r[0]*r[0]);
- cout<<"Aria este:";cout<<r[1];
- }break;
- case 3:
- {
- cout<<"Scrieti inaltimea si baza:";cin>>t[0];cint>>t[1];
- t[2] = (t[0]*t[1])/2;
- cout<<"Aria este:";cout<<t[2];
- }break;
- default: cout<<"Nu am gasit aceasta operatie";
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement