参考程序代码:
#include <iostream>int main() {int maxStudentsPerSubject = 9; // 每个科目最多有9个比哈利高的学生int students = maxStudentsPerSubject * 3; // 三个科目// 加上哈利自己int totalStudents = students + 1;std::cout << "最大学生人数: " << totalStudents << std::endl;return 0;
}
参考程序代码:
#include <iostream>int main() {int maxStudentsPerSubject = 9; // 每个科目最多有9个比哈利高的学生int students = maxStudentsPerSubject * 3; // 三个科目// 加上哈利自己int totalStudents = students + 1;std::cout << "最大学生人数: " << totalStudents << std::endl;return 0;
}