したらばTOP ■掲示板に戻る■ 全部 1-100 最新50 | |

test

20名無しさん:2009/07/23(木) 03:00:44
#include <stdio.h>
int score[100][3];
int max(int a, int b){ return a>=b?a:b; }
int min(int a, int b){ return a<=b?a:b; }
int main() {
&nbsp;&nbsp;int i, num, total, grand_total, total_max, total_min;
&nbsp;&nbsp;int math_total, math_max, math_min, sci_total, sci_max, sci_min, eng_total, eng_max, eng_min;

&nbsp;&nbsp;printf("Number of students?: "); scanf("%d", &num);
&nbsp;&nbsp;for(i=0; i<num; i++) {
&nbsp;&nbsp;&nbsp;&nbsp;printf("Input 3 scores for No. %03d Math, Sci and Eng: ", i+1);
&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d%d%d%*c", &score[i][0], &score[i][1], &score[i][2]);
&nbsp;&nbsp;}
&nbsp;&nbsp;printf("\nNo Math Sci Eng Total Mean\n");
&nbsp;&nbsp;printf("------------------------------------\n");
&nbsp;&nbsp;grand_total = math_total = sci_total = eng_total = 0;
&nbsp;&nbsp;total = score[0][0] + score[0][1] + score[0][2];
&nbsp;&nbsp;total_max = total_min = total;
&nbsp;&nbsp;math_max = math_min = score[0][0];
&nbsp;&nbsp;sci_max = sci_min = score[0][1];
&nbsp;&nbsp;eng_max = eng_min = score[0][2];


新着レスの表示


名前: E-mail(省略可)

※書き込む際の注意事項はこちら

※画像アップローダーはこちら

(画像を表示できるのは「画像リンクのサムネイル表示」がオンの掲示板に限ります)

掲示板管理者へ連絡 無料レンタル掲示板