My small white net class chose c but the final big homework won't do for bosses to help
CodePudding user response:
Define a structure array, two for loop input, don't forget to enter between two for getchar (), then the for judging an if, in the nested output corresponding results can,
CodePudding user response:
#include using namespace std; Id_n int * and * s_new; Void search (int id, int n); Void input (int id [], float scores [], int n); Int main () { String temp; Int long=1; int x; While (1) { cout<" Enter 1 storage, query input 2, illegal input exit "; Cin> x; If (x==1) { cout<" Storage result \ n ";
cout<" Please enter the student id "Cin> Temp. String id=split (temp, ""); Int longa=sizeof (scores)/sizeof (scores [0]).
cout<" Please enter the scores \ n "Cin> Temp. String scores=split (temp, ""); Long=sizeof (scores)/sizeof (scores [0]). If (longa==long) { Int independence idx [long]. Int score [long]. for(int i=0; iIndependence idx=atoi [I] [I] (id); Score [I]=atoi (scores [I]); } Input (independence idx, score, long); cout<" Success "& lt; } } Elseif (x==2) { cout<" The input query student id "\ n; Int y; Cin> y; If (long==1) { cout<" Not stored \ n "; continue; } Search (y, long); } The else { return 0; } } return 0; } Void search (int id, int n) { for(int i=0; iIf (id_n [I]==id) { cout<" Results & lt;" return; } } } Void input (int id [], float scores [], int n) { Id_n=new int [n]. S_n=new int [n]. for(int i=0; iId_n [I]=id [I]; S_n [I]=scores [I]; } }
Helpful hints: writing them not tested Cannot guarantee right, have a format to change His homework to write their own best
CodePudding user response:
To use pointer to complete for the small white good difficult