#include <iostream>
#include <fstream>
#include <string>
using namespace std;
 
 
struct Mid
{
  int alpha;
  string first, last;
};
 
int main()
{
 
  // Open file
  ifstream fin("Mids.txt");
 
  int n;
  fin >> n;
 
// Create and array of n Mids
  Mid *IC210 = new Mid[n];
 
  // Read in mids
  for(int i = 0; i < n; i++)
    fin >> IC210[i].alpha >> IC210[i].last >> IC210[i].first;
 
  int a;
  cout << "Enter an alpha: ";
  cin >> a;
 
// search for alpha a
  int k = 0;
  while(k < n && IC210[k].alpha != a)
    k++;
 
  // print result of search
  if (k == n)
    cout << "No Mid with that alpha was found!" << endl;
  else
    cout << IC210[k].first << " " << IC210[k].last << endl;
 
  return 0;
}

syntax highlighted by Code2HTML, v. 0.9.1