题解:P5744 【深基7.习9】培训
_OokoukioO_ · · 题解
题解
题目大意
给定
思路
直接模拟,名字不变,年龄需要
注意:score 必须为 double 类型,输出的时候直接输出 min(600, int(score * 1.2)) 就是最终答案。
AC 代码
#include <bits/stdc++.h>
using namespace std;
#define in cin
#define out cout
signed main() {
int t;
in >> t;
while (t--) {
string s; //名字
int year; //年龄
double score; //分数
in >> s >> year >> score;
out << s << ' ' << ++year << ' ' << min(600, int(score * 1.2)) << '\n'; //如上所述
}
return 0;
}