酷代码 AI
菜单
服务商

培训机构学员成绩与年龄更新:C++ 代码实现

```cpp #include <iostream> #include <string> using namespace std; struct Student { string name; int age; int last_score; }; int main() { int n; cin >> n; Student students[n]; for (int i = 0; i < n; i++) { cin >> students[i].name >> students[i].age >> students[i].last_score; } for (int i = 0; i < n; i++) { int new_age = students[i].age + 1; int new_score = students[i].last_score + 20; if (new_score > 600) { new_score = 600; } cout << students[i].name << " " << new_age << " " << new_score << endl; } return 0; } ``` ######[AI问答 | 186点数解答 | 2025-12-16 18:04:31]

相关提问
本站限时免费提问中
实用工具查看更多
Linux在线手册 [开发类]
Jquery在线手册 [开发类]
今日油价 [生活类]
图片互转base64 [开发类]
时间转换器 [开发类]