### 题目描述

//*****************begin***************
#include <iostream>
#include <iomanip>
using namespace std;
const double PI = 3.1415926;
class Table
{
public:

};

//声明圆桌子类
class RoundTable :public Table
{
public:

protected:
};

//声明方桌子类
class SquareTable:public Table
{
public:

protected:
double length;  //边长
};

//*****************end***************
int main( )
{
double r, l;
cin>>r>>l;   //输入圆桌子半径和方桌子边长
RoundTable a(r);     //创建圆桌子对象
SquareTable b(l);     //创建方桌子对象
Table *t;            //定义指向抽象类的指针t
t = &a;             //t指向了圆桌子对象
cout<<setiosflags(ios::fixed)<<setprecision(2);
cout<<"area of round table: "<<t->area()<<endl; //t->area()返回圆桌子面积
t = &b;               //t指向了方桌子对象
cout<<"area of square table: "<<t->area()<<endl; //t->area()返回方桌子面积
return 0;
}

2.13 3.2

### 样例输出

area of round table: 14.25
area of square table: 10.24

### 代码如下

``````#include<stdio.h>
const double PI = 3.1415926;
int main()
{
float a,b;
scanf("%f%f",&a,&b);
printf("area of round table: %.2f
area of square table: %.2f
",PI*a*a,b*b);
return 0;
}``````