1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#include <iostream>
#include <string>
using namespace std;
int main()
{
string a[100][4] = { {"111", "Tom" , "Jones" , "80"}, {"222", "Jack", "Williams", "70"},
{"333", "Sarah", "Johns", "100"}, {"444", "Judy", "Thomson", "99"}, {"555", "Sandra", "Will", "65"} };
string target;
cout << "Please enter a test score: " << endl;
cin >> target;
for (int i = 0; i < 5; i++)
{
if (target == a[i][3])
{
cout << "Students who had a " << target << " and above: " << endl;
cout << a[i][1] << " " << a[i][2] << endl;
}
}
system("Pause");
return 0;
}
|