C/C++の宿題を片付けます 93代目
at TECH
876:デフォルトの名無しさん
07/07/25 16:43:30
>>874
#include <stdio.h>
void main(){
int buf = 0;
int count = 0;
int total = 0;
printf("番号 数学 英語 合計\n");
while(scanf("%d",&buf)) {
if(buf == 0)
break;
count++;
printf("%d ", buf);
total += buf;
if(!(count%3)){
printf("%d\n", total);
total = 0;
}
}
}
なんにもエラー処理してないけどこんなんでいいかな・・・
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5375日前に更新/328 KB
担当:undef