你可以使用以下代码来实现你的需求:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define PI 3.1415926
int main(int argc, char* argv[]) {
int type;
scanf("%d", &type);
if (type == 1) {
// 求矩形面积
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a * b);
} else if (type == 2) {