90分求助
  • 板块题目总版
  • 楼主封禁用户
  • 当前回复4
  • 已保存回复4
  • 发布时间2024/10/1 14:57
  • 上次更新2024/10/1 16:59:59
查看原帖
90分求助
998963
封禁用户楼主2024/10/1 14:57

题目

我的代码

#include <iostream>
#include <cmath>
using namespace std;
double x, GPA;
int main()
{
	cin >> x;
	if (x >= 90) GPA = 4.0;
	else if (x >= 60 && x <= 89)
	{
		GPA = 4.0 - 0.1 * (90 - x);
	}
	else {
		x = 10 * sqrt(x);
		if (x >= 90) GPA = 4.0;
		else if (x >= 60 && x <= 89) GPA = 4.0 - 0.1 * (90 - x);
	}
	printf("%.1lf", GPA);
	return 0; 
}

评测记录

2024/10/1 14:57
加载中...