From 1eec7c6dc0d865451aff0bd14d20b620f69fc48b Mon Sep 17 00:00:00 2001 From: pifwgepx8 <947549275@qq.com> Date: Mon, 13 Nov 2023 16:25:52 +0800 Subject: [PATCH] ADD 2 --- 题目二.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 题目二.c diff --git a/题目二.c b/题目二.c new file mode 100644 index 0000000..afae943 --- /dev/null +++ b/题目二.c @@ -0,0 +1,44 @@ +#include +int main(){ + char a; + float s1[4]; + float s2[4]; + float s3[4]; + float an[3],b[3]; + int c[3]; + + + printf(" 1.Input\n"); + printf(" 2.Output\n"); + printf(" 3.Order\n"); + printf(" 4.Quit\n"); + scanf("%c",&a); + if(a=='i') + { + printf("You are trying to Input info\n"); + scanf("%d %f %f %f",&s1[0],&s1[1],&s1[2],&s1[3]); + scanf("%d %f %f %f",&s2[0],&s2[1],&s2[2],&s2[3]); + scanf("%d %f %f %f",&s3[0],&s3[1],&s3[2],&s3[3]); + printf("%d %.1f %.1f %.1f\n",s1[0],s1[1],s1[2],s1[3]); + printf("%d %.1f %.1f %.1f\n",s2[0],s2[1],s2[2],s2[3]); + printf("%d %.1f %.1f %.1f\n",s3[0],s3[1],s3[2],s3[3]); + } + else if(a=='o') + { + printf("You are trying to Output info"); + } + else if(a=='m') + { + printf("You are trying to Make things ordered"); + } + else if(a=='q') + { + printf("You are about to quit"); + } + else{ + printf("Wrong input"); + } + + + return 0; +}