### 题目描述

#include<ctime>
#include<iostream>
#define PI 3.14
using namespace std;

class Shape
{
public:

Shape(int c=0){color=c;}
int getColor(){return color;}
double area(){return 10000;};

protected:
int color;
};

class Point:public Shape
{
public:
Point(int c=0,double a=0,double b=0):Shape(c){x=a;y=b;}

double getX(){return x;}
double getY(){return y;}
double area(){return 0;}
protected:
double x,y;
};

class Circle:public Point
{
public:
Circle(int c=0,double a=0,double b=0,double r=0)

private:
};

class Rectangle:public Point
{
public:
Rectangle(int c=0, double a=0,double b=0,double w=0,double h=0):
Point(c,a,b),width(w),height(h){}

double getWidth(){return width;}
double getHeight(){return height;}
double area(){return width*height;}
private:
double width,height;
};

int main()
{
int i,k,a,b,r,c,w,h;
Shape *pt[3];
for(i=0;i<3;i++)
{
cin>>c;
cin>>a>>b;
cin>>k;
switch(k)
{
**************
小聪的Case语句
**************
}
}
for(i=0;i<3;i++)
{
cout<<"Shape"<<i<<":color:"<<pt[i]->getColor()<<
" position:"<<pt[i]->getX()<<","<<pt[i]->getY()<<
" area:"<<pt[i]->area()<<endl;
}
return 0;
}

5 1 2
0
6 2 3
1
1
7 3 4
2
10 20

### 样例输出

Shape0:color:5 position:1,2 area:0
Shape1:color:6 position:2,3 area:3.14
Shape2:color:7 position:3,4 area:200

### 代码如下

``````#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define PI 3.14
int main()
{
int a,b,c,d,e,f;
double area;
for(int i=0;i<3;i++)
{
scanf("%d%d%d",&a,&b,&c);
scanf("%d",&d);
if(d==0)area=0;
else if(d==1)
{
scanf("%d",&e);
area=PI*e*e;
}
else if(d==2)
{
scanf("%d%d",&e,&f);
area=f*e;
}
printf("Shape%d:color:%d position:%d,%d area:%g
",i,a,b,c,area);
}
return 0;
}``````