diff --git a/2207/C语言同步练习/选择结构/3.c b/2207/C语言同步练习/选择结构/3.c new file mode 100644 index 0000000..6a75b09 --- /dev/null +++ b/2207/C语言同步练习/选择结构/3.c @@ -0,0 +1,19 @@ +#include + +int main(){ + + float a, b, result; + int flag; + printf(":"); + scanf("%f %f", &a, &b); + printf("ҪеIJ(1.ӷ 2.˷ 3.):"); + scanf("%d", &flag); + switch(flag){ + case 1:result = a+b;break; + case 2:result = a*b;break; + case 3:result = a/b;break; + } + printf("Ϊ%f\n", result); + + return 0; +} diff --git a/2207/C语言同步练习/选择结构/3.exe b/2207/C语言同步练习/选择结构/3.exe new file mode 100644 index 0000000..6456a06 Binary files /dev/null and b/2207/C语言同步练习/选择结构/3.exe differ