-1
我是谁不工作if语句里面for或while循环
它只能显示第一COUT进入1个学生信息
或醚它跳过循环,并尽一切下循环它
可以请你帮
int x = 1;
while (x <= 10) {
++x;
if (x = 1) {
cout << "enter 1 student info";
cin >> name >> first >> second >> final>>id;
} else if (x = 2) {
cout << "enter 2 student info";
cin >> name1 >> first1 >> second1 >> final1 >> id1;
} else if (x = 3) {
cout << "enter 3 student info";
cin >> name2 >> first2 >> second2 >> final2 >> id2;
} else if (x = 4) {
cout << "enter 4 student info";
cin >> name3 >> first3 >> second3 >> final3 >> id3;
}
}
...
for (int x = 1; x <= 9; x++) {
if (x = 1) {
cout << "enter 1 student info";
cin >> name >> first >> second >> final>>id;
}
if (x = 2) {
cout << "enter 2 student info";
cin >> name1 >> first1 >> second1 >> final1 >> id1;
}
if (x = 3) {
cout << "enter 3 student info";
cin >> name2 >> first2 >> second2 >> final2 >> id2;
}
if (x = 4) {
cout << "enter 4 student info";
cin >> name3 >> first3 >> second3 >> final3 >> id3;
}
}
“做作经营者”这是一个新的 –
对不起,只是一个法语单词,谢谢编辑:) – Jerome