#include <stdio.h>#include <stdlib.h>#include <conio.h>#include <windows.h>#include <time.h>int main(){ int a,b,c,d,i,f,g; char q; a=0; b=0; c=0; d=0; i=0; f=0; g=0; printf(" 计算面积\n"); printf(" 1:正方形 2:长方形 3:三角形 4:平行四边形 5:梯形\n"); printf(" 输入1~5有效,其他无效") q=getch(); while (q=5) { system("cls"); printf("上底 下底 高 先空行,在写数,写完后按回车"); scanf("3个%d",&a,&b,&c); i=(a+b)c/2; printf("%d",i); system("pause"); return 0; } while (q=4) { system("cls"); printf("底 高 先空行,在写数,写完后按回车"); scanf("%d%d",&a,&b); i=ab; printf("%d",i); system("pause"); return 0;} while (q=3) { system("cls"); printf("底 高 先空行,在写数,写完后按回车"); scanf("%d%d",&a,&b); i=ab/2; printf("%d",i);system("pause"); return 0; } while (q=2) {system("cls"); printf("长 宽 先空行,在写数,写完后按回车"); scanf("%d%d",&a,&b); i=ab; printf("%d",i); system("pause"); return 0; } while (q=1) { system("cls"); printf("长 先空行,在写数,写完后按回车"); scanf("%d",&a); i=aa; printf("%d",i); system("pause"); return 0; } }
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
#include <time.h>
int main(){
int a,b,c,d,i,f,g;
char q;
a=0; b=0; c=0; d=0; i=0; f=0; g=0;
printf(" 计算面积\n");
printf(" 1:正方形 2:长方形 3:三角形 4:平行四边形 5:梯形\n");
printf(" 输入1~5有效,其他无效");
q=getchar();
getchar();
while (q=='5') {
system("cls");
printf("上底 下底 高 先空行,在写数,写完后按回车");
scanf("3%d",&a,&b,&c);
i=(a+b)*c/2;
printf("%d",i);
system("pause");
return 0;
}
while (q=='4') {
system("cls");
printf("底 高 先空行,在写数,写完后按回车");
scanf("%d%d",&a,&b);
i=a*b;
printf("%d",i);
system("pause");
return 0;
}
while (q=='3') {
system("cls");
printf("底 高 先空行,在写数,写完后按回车");
scanf("%d%d",&a,&b);
i=a*b/2;
printf("%d",i);
system("pause");
return 0;
}
while (q=='2') {
system("cls");
printf("长 宽 先空行,在写数,写完后按回车");
scanf("%d%d",&a,&b);
i=a*b;
printf("%d",i);
system("pause");
return 0;
}
while (q=='1') {
system("cls");
printf("长 先空行,在写数,写完后按回车");
scanf("%d",&a);
i=a*a;
printf("%d",i);
system("pause");
return 0;
}
}
#include <stdio.h>#include <stdlib.h>#include <conio.h>#include <windows.h>#include <time.h>int main()
{ int a,b,c,d,i,f,g; char q; a=0; b=0; c=0; d=0; i=0; f=0; g=0;
printf(" 计算面积\n");
printf(" 1:正方形 2:长方形 3:三角形 4:平行四边形 5:梯形\n");
printf(" 输入1~5有效,其他无效")
q=getch();
while (q=5) {
system("cls"); printf("上底 下底 高 先空行,在写数,写完后按回车");
scanf("3个%d",&a,&b,&c);
i=(a+b)c/2; printf("%d",i); system("pause"); return 0; }
while (q=4)
{
system("cls"); printf("底 高 先空行,在写数,写完后按回车");
scanf("%d%d",&a,&b); i=ab;
printf("%d",i); system("pause"); return 0;
}
while (q=3)
{
system("cls");
printf("底 高 先空行,在写数,写完后按回车");
scanf("%d%d",&a,&b); i=ab/2; printf("%d",i);
system("pause");
return 0;
}
while (q=2)
{
system("cls");
printf("长 宽 先空行,在写数,写完后按回车");
scanf("%d%d",&a,&b); i=ab; printf("%d",i);
system("pause");
return 0;
}
while (q=1)
{
system("cls"); printf("长 先空行,在写数,写完后按回车");
scanf("%d",&a);
i=aa;
printf("%d",i); system("pause");
return 0;
}
}
排版都没有,你自己都看不懂自己的代码,叫别人怎么看?