2025-03-20

This commit is contained in:
smallkun 2025-03-20 11:23:46 +08:00
parent 2f7f806aab
commit 297f2784fb
2 changed files with 27 additions and 0 deletions
2207

@ -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
![image-20250227231434183](https://yp.smallkun.cn/markdown/image-20250227231434183.png!compress)
```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;
}
```
## 文件