学分绩点计算C源代码
#include #include int main() { float score 0.0; float grade_point = 0.0; float avg1 = 0.0; float avg2 = 0.0; float GPA = 0.0; int count = 0; while(score>0) { printf(\"请输入课程学分数:\"); scanf(\"%f\ printf(\"请输入课程成绩:\"); scanf(\"%f\ if(score<60) score=0.0; if(score<=69&&score>=60) score=1.0+score-60; if(score<=79&&score>=70) score=1.0+score-70; if(score<=89&&score>=80) score=1.0+score-80; if(score<=100&&score>=90) score=1.0+score-90; avg1 = avg1 + (grade_point*score); avg2 = avg2 + grade_point; } GPA = avg1/avg2; printf(\"该门课程的GPA=%f\\n\ return 0; } 因篇幅问题不能全部显示,请点此查看更多更全内容