?? gymjudge.c
字號(hào):
/* * File: gymjudge.c * ---------------- * This program averages a set of five gymnastic scores. */#include <stdio.h>#include "genlib.h"#include "simpio.h"/* * Constants * --------- * NJudges -- Number of judges */#define NJudges 5/* Main program */main(){ double gymnasticScores[NJudges]; double total, average; int i; printf("Please enter a score for each judge.\n"); for (i = 0; i < NJudges; i++) { printf("Score for judge #%d: ", i); gymnasticScores[i] = GetReal(); } total = 0; for (i = 0; i < NJudges; i++) { total += gymnasticScores[i]; } average = total / NJudges; printf("The average score is %.2f\n", average);}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -