From 4e52aad31aff148bdefb92e4edff38e0ef3ce2bc Mon Sep 17 00:00:00 2001 From: smallkun Date: Fri, 21 Feb 2025 08:31:41 +0800 Subject: [PATCH] Auto commit --- 2207/C语言同步练习源码/2.循环结构-3.c | 22 ++++++++++++++++++++++ 2207/C语言同步练习答案.md | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 2207/C语言同步练习源码/2.循环结构-3.c diff --git a/2207/C语言同步练习源码/2.循环结构-3.c b/2207/C语言同步练习源码/2.循环结构-3.c new file mode 100644 index 0000000..b8b42a7 --- /dev/null +++ b/2207/C语言同步练习源码/2.循环结构-3.c @@ -0,0 +1,22 @@ +#include +/* +:i +:j +С:k +*/ + +int main(){ + int i, j , k; + for(i=0;i<=33;i++){ + for(j=0;j<=50;j++){ + for(k=0;k<=200;k+=2){ + if(i+j+k==100 && i*3 + j*2 + k/2 == 100){ + printf(":%-2d :%-2d С:%-2d\n", i, j, k); + } + } + } + } + + + return 0; +} diff --git a/2207/C语言同步练习答案.md b/2207/C语言同步练习答案.md index 5736edf..3b18212 100644 --- a/2207/C语言同步练习答案.md +++ b/2207/C语言同步练习答案.md @@ -224,6 +224,28 @@ int main(){ ![image-20250220230952843](https://yp.smallkun.cn/markdown/image-20250220230952843.png!compress) ```c +#include +/* +大马:i +中马:j +小马:k +*/ + +int main(){ + int i, j , k; + for(i=0;i<=33;i++){ + for(j=0;j<=50;j++){ + for(k=0;k<=200;k+=2){ + if(i+j+k==100 && i*3 + j*2 + k/2 == 100){ + printf("大马:%-2d 中马:%-2d 小马:%-2d\n", i, j, k); + } + } + } + } + + + return 0; +} ``` ### 循环结构-4