首页 > 试题广场 >

学分绩点

[编程题]学分绩点
  • 热度指数:10460 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 64M,其他语言128M
  • 算法知识视频讲解
北京大学对本科生的成绩施行平均学分绩点制(GPA)。既将学生的实际考分根据不同的学科的不同学分按一定的公式进行计算。 公式如下: 实际成绩 绩点 90——100 4.0 85——89 3.7 82——84 3.3 78——81 3.0 75——77 2.7 72——74 2.3 68——71 2.0 64——67 1.5 60——63 1.0 60以下 0 1.一门课程的学分绩点=该课绩点*该课学分 2.总评绩点=所有学科绩点之和/所有课程学分之和 现要求你编写程序求出某人A的总评绩点(GPA)。

输入描述:
第一行 总的课程数n(n<10);
第二行 相应课程的学分(两个学分间用空格隔开);
第三行 对应课程的实际得分;
此处输入的所有数字均为整数。


输出描述:
输出有一行,总评绩点,精确到小数点后2位小数。(printf("%.2f",GPA);)
示例1

输入

5
4 3 4 2 3
91 88 72 69 56

输出

2.52
头像 用户抉择
发表于 2021-03-28 21:08:53
#include <stdio.h> int main(){     int n,i,sum;     float GPA;    &nb 展开全文
头像 MrMello
发表于 2023-03-15 14:28:28
#include <stdio.h> //成绩对应学分 float getGPA(int x){ if (x>=90) return 4.0; else if(x >= 85) return 3.7; else if(x >= 82) 展开全文
头像 小徐小徐啊啊
发表于 2024-03-06 20:48:16
#include <stdio.h> int main() { int n; scanf("%d",&n); float a[n],b[n],s[n],c=0,d=0,sum=0; for(int i=0;i<n;i++) { sca 展开全文
头像 机试秒杀者
发表于 2025-03-15 14:36:40
#include<bits/stdc++.h> using namespace std; float GPA(int k) { if(k>=90 && k<=100)return 4.0; else if(85<=k && 展开全文
头像 牛客440904392号
发表于 2024-09-29 19:06:14
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n 展开全文
头像 想当offer收割机的母单花很人来疯
发表于 2025-03-13 20:20:13
#include<cstdio> #include<iostream> #include<vector> using namespace std; /*北京大学对本科生的成绩施行平均学分绩点制(GPA)。既将学生的实际考分根据不同的学科的不同学分按一定的公式进行计 展开全文
头像 T790T
发表于 2024-07-27 09:28:17
#include <bits/stdc++.h> using namespace std; vector<int> v_cre; vector<int> v_sco; double gpa(int cre,int sco) { if(90 <= s 展开全文
头像 给我就亿下
发表于 2023-03-09 20:09:13
#include <iostream> using namespace std; const int MAXN = 10; int xuefen[MAXN]; int shijidefen[MAXN]; double shijichengjijidian (int a){ if 展开全文
头像 陶良策
发表于 2025-02-16 16:21:42
#include <iostream> using namespace std; int main() { int n; int a[10]={0},b[10]={0}; while (scanf("%d",&n)!=EOF) { / 展开全文
头像 挂耳coffe
发表于 2025-03-11 11:03:04
#include <iostream> #include <string> #include <algorithm> #include <cstdio> using namespace std; const int N = 10; int n; 展开全文