2025-03-20
This commit is contained in:
parent
2f7f806aab
commit
297f2784fb
13
2207/C语言同步练习源码/7-结构体-3.c
Normal file
13
2207/C语言同步练习源码/7-结构体-3.c
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
typedef struct score{
|
||||||
|
float medScore;
|
||||||
|
float endScore;
|
||||||
|
}score;
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
score s;
|
||||||
|
scanf("%f %f", &s.medScore, &s.endScore);
|
||||||
|
|
||||||
|
printf("avg=%.2f\n", (s.medScore + s.endScore)/2);
|
||||||
|
return 0;
|
||||||
|
}
|
@ -1010,7 +1010,21 @@ int main(){
|
|||||||
### 结构体-3
|
### 结构体-3
|
||||||
|
|
||||||

|

|
||||||
|
```c
|
||||||
|
#include <stdio.h>
|
||||||
|
typedef struct score{
|
||||||
|
float medScore;
|
||||||
|
float endScore;
|
||||||
|
}score;
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
score s;
|
||||||
|
scanf("%f %f", &s.medScore, &s.endScore);
|
||||||
|
|
||||||
|
printf("avg=%.2f\n", (s.medScore + s.endScore)/2);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## 文件
|
## 文件
|
||||||
|
Loading…
x
Reference in New Issue
Block a user