奥数与C++小学四年级(第十六题 魔法学院)

参考程序代码:

#include <iostream>

int main() {
   
    int maxStudentsPerSubject = 9; // 每个科目最多有9个比哈利高的学生
    int students = maxStudentsPerSubject * 3; // 三个科目

    // 加上哈利自己
    int totalStudents = students + 1;

    std::cout << "最大学生人数: " << totalStudents << std::endl;

    return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_60445850/article/details/143392400