From e82bfd4827614307b2f835cf976cefc1fae98f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E4=B8=96=E6=B3=A2?= <2783626707@qq.com> Date: Wed, 8 Nov 2023 23:14:51 +0800 Subject: [PATCH] merge input and output --- output.c | 15 --------------- input.c => stuIO.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 output.c rename input.c => stuIO.c (72%) diff --git a/output.c b/output.c deleted file mode 100644 index 0711a3b..0000000 --- a/output.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "mysyslib.h" - -void Print(Student*student){ - printf("%s,%s,%s,%.1lf,%.1lf,%.1lf,%.1lf\n",student->id,student->class,student->name,student->score1,student->score2,student->score3,student->score); -} - -void allPrint(ss*stu){ - if(stu->nums){ - for(int i = 0; i < stu->nums; ++i){ - Print(&stu->student[i]); - } - }else{ - printf("No data exist\n"); - } -} diff --git a/input.c b/stuIO.c similarity index 72% rename from input.c rename to stuIO.c index 4b81332..caa5b82 100644 --- a/input.c +++ b/stuIO.c @@ -37,3 +37,18 @@ void input(ss*stu){ return; } + +//输出相关 +void Print(Student*student){ + printf("%s,%s,%s,%.1lf,%.1lf,%.1lf,%.1lf\n",student->id,student->class,student->name,student->score1,student->score2,student->score3,student->score); +} + +void allPrint(ss*stu){ + if(stu->nums){ + for(int i = 0; i < stu->nums; ++i){ + Print(&stu->student[i]); + } + }else{ + printf("No data exist\n"); + } +}