VC++わかる人
最新 最初 全 ![🆕](http://img.ryne.jp/emoji/63874.gif)
#38 [rudy]
/**/は無視してもらって結構ですw
訂正:ALL_TOTAL_AVE関数のtotalをfloat型に変えてください(泣
:07/07/22 18:59
:PC
:GG4r0F5E
#39 [えり]
ALL_FLOAT_AVEってことですよね
![](http://img.ryne.jp/emoji/63904.gif)
?
:07/07/22 19:28
:SH903i
:kZazB9Ss
#40 [rudy]
うん(´∀`)
ってか、下のを丸ごと写してww
void ALL_TOTAL_AVE(int *arr1, int *arr2, int *arr3)
{
float total = 0; /*floatに*/
int count = 0;
int i;
for (i=0; i<5; i++) {
total += arr1[i];
count++;
}
for (i=0; i<5; i++) {
total += arr2[i];
count ++;
}
for (i=0; i<5; i++) {
total += arr3[i];
count++;
}
printf("全ての合計:%d\n",(int)total); /*int型へキャスト変換*/
printf("全ての平均:%f\n",total/count);
}
:07/07/22 19:38
:PC
:GG4r0F5E
#41 [えり]
ALL_TOTAL_AVE(G1,G2,G3);
void ALL_TOTAL_AVE(int *arr1, int *arr2, int *arr3)
{
float total = 0; /*floatに*/
int count = 0;
int i;
for (i=0; i<5; i++) {
total += arr1[i];
count++;
}
for (i=0; i<5; i++) {
total += arr2[i];
count ++;
}
for (i=0; i<5; i++) {
total += arr3[i];
count++;
}
printf("全ての合計:%d\n",(int)total); /*int型へキャスト変換*/
printf("全ての平均:%f\n",total/count);
}
return 0;
}
こんな感じですか?
:07/07/22 19:43
:PC
:bUxWvbe.
#42 [rudy]
うん。
だけど・・・return 0;はいらないよ(´∀`)
:07/07/22 20:05
:PC
:GG4r0F5E
#43 [えり]
:07/07/22 20:20
:SH903i
:kZazB9Ss
#44 [えり]
rudyさんいますか
![](http://img.ryne.jp/emoji/63952.gif)
![](http://img.ryne.jp/emoji/63912.gif)
:07/07/23 13:34
:SH903i
:bBrN96u.
#45 [えり]
コマンドプロンプト?で
読み込んだんですけど
![](http://img.ryne.jp/emoji/63931.gif)
![](http://img.ryne.jp/emoji/63915.gif)
void ALL_TOTAL_(int *arr1, int *arr2, int *arr3) ←ここでは宣言できない
} ←宣言の構文エラー
あと1番最後の…
} ←エラー:宣言に;がない
警告:関数は値を返すべき
エラー:不要な}
って出てきてしまうんです
![](http://img.ryne.jp/emoji/63955.gif)
どしたらいいでしょうか
![](http://img.ryne.jp/emoji/63952.gif)
![](http://img.ryne.jp/emoji/63912.gif)
:07/07/23 14:57
:SH903i
:bBrN96u.
#46 [rudy]
面倒くさいからメールしてくれい(´・ω・`)
:07/07/23 15:16
:PC
:DExr8d0M
#47 [名前未登録]
整数a、bの最大公約数を求めるプログラミングを教えてください。いまの自分のC言語の力ではわからなくて困っています…
:07/07/24 02:53
:W41CA
:jBhYxc8Q
★コメント★
←次 | 前→
トピック
C-BoX E194.194