(对c ++来说是新手,不错)
我希望能够要求用户输入与名单中所说的一样多的学生姓名。因此,基本上,我想使用整数来回答问题。
(是的,我在python上看到了类似的问题,但我不知道如何将其应用于c ++。)
我知道它涉及while循环。我知道如何增加。我已经建立了一个while循环,我所需要的只是正确的条件。
//Num_Students equals the number of students the user has.
//Students_List equals the student number that I am asking for. Such as
//Student 1,and so on
//s1 is a string that holds the name of the student.
while (Num_Students =) {
Students_List = 1;
cout << "Enter the full name of student " << Students_List << " >";
cin >> s1;
Students_List++;
}
我希望输出像这样:
输入学生1的全名>哔声
输入学生2的全名> bop
输入学生3的全名> boop
以此类推。