C++11:50分求助个位dalao神犇!
查看原帖
C++11:50分求助个位dalao神犇!
977778
__Harry_Haiyun__楼主2023/6/22 22:06

C++11:50分求助个位dalao神犇!

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int x;
	cin >> x;
	double GPA = 4.0;
	if (x >= 90) 
	{
		cout << 4 << ".0" << endl;
		return 0;
	}
	if (x >= 60 && x <= 89)
	{
		for (int i = 90; i > x; i++) GPA -= 0.1;
		printf("%.1lf",GPA);
		return 0;
	}
	if (x < 60) x = floor(sqrt(x));
	if (x >= 60) printf("%.1lf",x);
	else cout << 0 << ".0" << endl;
	return 0;
}
#1 #2 #8 #9 #10 AC
#6 #7 WA
#3 #4 #5 TLE
2023/6/22 22:06
加载中...