#include <iostream>
#include <string.h>
#include<stdlib.h>
#include <stdio.h>
using namespace std;
#include <iostream>
const int maxStudent = 100;
const int maxNameLen = 20;
int main() {
    	long int idList[maxStudent] ;
    	float averageList[maxStudent] ;
    	char nameList[maxStudent][maxNameLen] ;
    	long int searchId;
    	int i, n;
    	cout<<"  enter student number : ";
    	cin>>n;
    	for (i=0; i<n; i++) {
     		cout<<"  student # : "<< i+1<<endl ;
    		cout<<"  enter id : ";
    		cin>>idList[i];
    		cout<<"  enter name : ";
    		cin>> nameList[i];
    		cout<<"  enter average : ";
    		cin>>averageList[i];
	    }
	    while(1) {
    		cout<<"  enter student id (0 to exit) : ";
    		cin>>searchId;
    		if (!searchId) break ;
    		for (i=0 ; i<n; i++)
    		if (idList[i] == searchId) break;
    		if (i<n) {
           cout<<"  Student specifications : \n";
            	cout<<"  id= "<<idList[i]<<" , "<<"name= "<<nameList[i]<<" , "<<"average="
            	                                                                 <<averageList[i]<<endl;
    		}
    		else cout<<" student not found !\n";
      	}
	return 0;
 }
