#include
#include<stdio.h>
struct preson
{
char name[10];
int grade;
}student[11] = { ("Mary", 13), ("John", 11), ("Ricky", 6), ("Tom", 4), ("Jane", 1), ("Keith", 5), ("Leo", 9), ("Ada", 12), ("Ann", 2), ("Pandora", 3), ("Olivia", 19) };
using namespace std;
int main()
{
char a[10];
int i;
cout << "Enter name : ";
cin >> a;
for (i = 0; i < 11; i++) {
if (a != student[i].name) {
continue;
}
cout << "The id of " << a << " is " << student[i].grade;
}
return 0;
}
整段包起來不要只包一段...
所以你的問題是甚麼?
如果你的問題只有這樣
請問程式我要如何改變輸出結果?
那我的回答就是
那就改變你寫的內容啊.