1 条题解
-
0
自动搬运
来自洛谷,原作者为

OokoukioO
小号,已红搬运于
2025-08-24 22:13:58,当前版本为作者最后更新于2025-07-01 00:15:17,作者可能在搬运后再次修改,您可在原文处查看最新版自动搬运只会搬运当前题目点赞数最高的题解,您可前往洛谷题解查看更多
以下是正文
题解
题目大意
给定 个人的名字、年龄、去年 NOIP 分数,设他们每个人今年的分数都会比去年提高 ,求他们今年的 NOIP 成绩。
思路
直接模拟,名字不变,年龄需要 ,分数最高上限为 ,所以我们直接输出 就行了。
注意:
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; }
- 1
信息
- ID
- 4722
- 时间
- 1000ms
- 内存
- 125MiB
- 难度
- 1
- 标签
- (无)
- 递交数
- 0
- 已通过
- 0
- 上传者