C/C++の宿題を片付けます 120代目at TECH
C/C++の宿題を片付けます 120代目 - 暇つぶし2ch271:デフォルトの名無しさん
08/12/18 06:38:13
>>239(あまり検証してない)

#include <stdio.h>

#define NINZU 3
#define KAMOKU 4

int main()
{
int ten[NINZU][KAMOKU]={ /*国語、算数、理科、社会の順に格納*/
{69,62,68,72}, /*伊藤くんの成績*/
{28,100,88,48}, /*田中さんの成績*/
{60,48,65,76}}; /*林くんの成績*/
int total = 0; /*合計点数*/
int i, j, all60over;

for (i=0; i<NINZU; i++) {
total = 0;
all60over = 1;
for (j=0; j<KAMOKU; j++) {
total += ten[i][j];
if (ten[i][j] < 60) all60over = 0;
}

if (total >= 260 || all60over) {
printf("OK\n");
} else {
printf("NG\n");
}
}
return 0;
}


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch