C语言求助(急)

来源:百度知道 编辑:UC知道 时间:2024/05/15 18:43:56
#include "stdio.h"
main()
{ int N,r,l,s,v,Pi=3.14,b,h;
Start:printf("Choose which one do you want to do:\n1.Square 2.Rectangle 3.Circle 4.Spheroid");
scanf("%d",&N);
switch(N)
{case 1: printf("Input the l(/cm) of the square:\n");
scanf("%d",&l);
s=l*l;
printf("The S of the square is %d/cm*cm",s);
case 2: printf("Input the l(/cm) and b of the rectangle:\n");
scanf("%d%d",&l&b);
s=l*b;
printf("The S of the Rectangle is %d/cm*cm,s");
case 3: printf("Input the r(/cm) of the Circle:\n");
scanf("%d".&r);
s=pi*r*r;
printf("The S of the Circle is %d/cm*cm,s");
case 4: printf("Input the r(/cm) of the Spheroid");
sc

#include "stdio.h"
#include <conio.h> //增加 否则getch();编译错
main()
{ int N,r,l,s,v,Pi=3.14,b,h;
Start:printf("Choose which one do you want to do:\n1.Square 2.Rectangle 3.Circle 4.Spheroid");
scanf("%d",&N);
switch(N)
{case 1: printf("Input the l(/cm) of the square:\n");
scanf("%d",&l);
s=l*l;
printf("The S of the square is %d/cm*cm",s);
break;
case 2: printf("Input the l(/cm) and b of the rectangle:\n");
scanf("%d%d",&l,&b);//此处少个,
s=l*b;
printf("The S of the Rectangle is %d/cm*cm",s);//s应该写到“”外面
break; //增加
case 3: printf("Input the r(/cm) of the Circle:\n");
scanf("%d",&r);//.改成,
s=Pi*r*r;
printf("The S of the Circle is %d/cm*cm",s);//s应该写到“”外面