Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- #include <iostream>
- struct SSquare {
- float size;
- };
- struct SRectangale {
- float a, b;
- };
- void main()
- {
- SSquare squares[20];
- SRectangale rectangles[20];
- cout << "How many squares do we have: "<<endl;
- int nS;
- cin >> nS;
- for (int i = 0; i < nS;i++) {
- cout << "Size of sqare "<< i+1<<endl;
- cin >> squares[i].size;
- float area(SSquare q); {
- cout<< "Area of square number " << i + 1<<" is "<< squares[i].size * squares[i].size << endl;
- }
- }
- cout << "How many rectangles do we have: "<<endl;
- int nR;
- cin >> nR;
- for (int i = 0; i < nR;i++) {
- cout << "Size of rectangle "<<i+1<<endl;
- cin >> rectangles[i].a;
- cin >> rectangles[i].b;
- float area(SSquare q); {
- cout << "Area of rectangle number "<<i+1<<" is " << rectangles[i].a * rectangles[i].b << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment