Five students four grades for input and output, the output according to the average
CodePudding user response:
Is this problem
Is a student at a school
Or give the same answer, write their own code, encounter problems post and ask questions, to the source code of baidu to himself
CodePudding user response:
Fun
reference 1 floor response: this problem againIs a student at a school Or give the same answer, write their own code, encounter problems post questions, go to source their baidu I don't quite understand how to implement a comparative, implement all grades reorder CodePudding user response:
Struct Student { Int id; Int. J score [4]; Float avg. } student [100]; Entry at the same time, the achievement of calculating average son inside the van gogh avg According to the thinking of bubble sort, to the student/?? Avg and studnent [j]. Journal of avg, exchange data line CodePudding user response:
Fun reference 3 floor response: struct Student { Int id; Int. J score [4]; Float avg. } student [100]; Entry at the same time, the achievement of calculating average son inside the van gogh avg According to the thinking of bubble sort, to the student/?? Avg and studnent [j]. Journal of avg, exchange data line I don't quite understand brother write programs such as the first line CodePudding user response:
Fun reference 3 floor response: struct Student { Int id; Int. J score [4]; Float avg. } student [100]; Entry at the same time, the achievement of calculating average son inside the van gogh avg According to the thinking of bubble sort, to the student/?? Avg and studnent [j]. Journal of avg, exchange data line If use the bubble sort, how to implement the entire student achievement sort CodePudding user response:
Fun reference 3 floor response: struct Student { Int id; Int. J score [4]; Float avg. } student [100]; Entry at the same time, the achievement of calculating average son inside the van gogh avg According to the thinking of bubble sort, to the student/?? Avg and studnent [j]. Journal of avg, exchange data line If simple compare average is used less bubble sort CodePudding user response:
Input data into struct student student this structure array [100] inside Entry process at the same time, calculate the average son into the avg variable inside the Then you are not according to the average sort? 30 students, for example, the sorting needs an algorithm that bubble is all in the book some algorithm Comparison is in the process of bubble sort, according to the result after comparing the exchange of data, the whole structure of all content exchange, a data exchange not only avg CodePudding user response:
Fun reference 7 floor response: input data into struct student student this structure array [100] inside Entry process at the same time, calculate the average son into the avg variable inside the Then you are not according to the average sort? 30 students, for example, the sorting needs an algorithm that bubble is all in the book some algorithm Comparison is in the process of bubble sort, according to the result after comparing the exchange of data, the whole structure of exchange, everything is not only one data exchange avg Actually, I don't know yet structure array # include & lt; Stdio. H> Int main () { int i,j; Float a [5], [4], the sum [4]={0}; Printf (" \ t 2 \ \ t course 1 \ t t 3 \ t course 4 \ n "); for(i=0; i<5; I++) { Printf (" % d ", I + 1); for(j=0; J<4. J++) The scanf (" % f ", & amp; A [I] [j]); } for(j=0; J<4. J++) for(i=0; i<5; I++) The sum [I] +=a, [I] [j]. Printf (" the result for t \ \ t \ n "); Printf (" \ t 1 \ t course 2 \ t 3 \ t course scored an average 4 \ t \ n "); for(i=0; i<5; I++) { Printf (" \ n students % d: \ t ", I + 1); for(j=0; J<4. J++) Printf (" % 1 \ t f ", a [I] [j]); Printf (" % 1 f ", sum [I]/4); printf("\n"); } return 0; } If on this foundation how to sort CodePudding user response:
You will never be a sum of bubble sort, Write the code, in exchange of the sum of the data, at the same time, the exchange of a array data For I The for. J If the sum is to exchange after the sun [x] and sum the words of [y] { T=sum (x), Sum (x)=sum [y] sum [y]=t;//this sum data exchange, so synchronous added up and down the For (k=0; k<4. K++) { T=a, [x] [k]. A [x] [k]=[y] a [k]. A [y] [k]=t; }.//guarantor and the sum of the data from a data or correspondence } CodePudding user response:
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html