Auto commit
This commit is contained in:
parent
e3beb59bcf
commit
4e52aad31a
22
2207/C语言同步练习源码/2.循环结构-3.c
Normal file
22
2207/C语言同步练习源码/2.循环结构-3.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
/*
|
||||
大马: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;
|
||||
}
|
@ -224,6 +224,28 @@ int main(){
|
||||

|
||||
|
||||
```c
|
||||
#include <stdio.h>
|
||||
/*
|
||||
大马: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
|
||||
|
Loading…
x
Reference in New Issue
Block a user