/*
C/C++の宿題片付けます 161代目
http://t...content-available-to-author-only...h.net/test/read.cgi/tech/1354070278/
125 名前:デフォルトの名無しさん [sage]: 2012/12/06(木) 10:12:21.78
[1] 授業単元:c言語 関数&配列
[2] 問題文 関数配列の問題です。
http://www.dotup.org/uploda/www.dotup.org3703015.pdf
[3] 環境
[3.1] OS: Linux
[3.2] コンパイラ名とバージョン: gcc
[3.3] 言語: C
[4] 期限:12/11
ポインターは使わずによろしくお願いいたします
2.
*/
#include<stdio.h>
double inpro(double a[], double b[], int n)
{
int i;
double s;
s = 0.0;
for (i = 0; i < n; i++) {
s += a[i] * b[i];
}
return s;
}
int main()
{
double a[] = { 1.0, 2.0, 3.0 };
double b[] = { 3.0, 2.0, 1.0 };
int i;
int n = sizeof(a) / sizeof(double);
for (i = 0; i < n; i++) {
}
for (i = 0; i < n; i++) {
}
printf("inpro(a, b, %d) = %f\n", n
, inpro
(a
, b
, n
)); }
LyoKICAgIEMvQysr44Gu5a6/6aGM54mH5LuY44GR44G+44GZIDE2MeS7o+ebrgogICAgaHR0cDovL3QuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLmgubmV0L3Rlc3QvcmVhZC5jZ2kvdGVjaC8xMzU0MDcwMjc4LwogICAgICAgIDEyNSDlkI3liY3vvJrjg4fjg5Xjgqnjg6vjg4jjga7lkI3nhKHjgZfjgZXjgpMgW3NhZ2Vd77yaIDIwMTIvMTIvMDYo5pyoKSAxMDoxMjoyMS43OCAgCiAgICAgICAgWzFdIOaOiOalreWNmOWFg++8mmPoqIDoqp4g6Zai5pWw77yG6YWN5YiXCiAgICAgICAgWzJdIOWVj+mhjOaWh+OAgOmWouaVsOmFjeWIl+OBruWVj+mhjOOBp+OBmeOAggogICAgICAgIO+9iO+9lO+9lO+9kO+8mi8vd3d3LmRvdHVwLm9yZy91cGxvZGEvd3d3LmRvdHVwLm9yZzM3MDMwMTUucGRmCiAgICAgICAgWzNdIOeSsOWigyAKICAgICAgICDjgIBbMy4xXSBPU++8miBMaW51eCAKICAgICAgICDjgIBbMy4yXSDjgrPjg7Pjg5HjgqTjg6nlkI3jgajjg5Djg7zjgrjjg6fjg7PvvJogZ2NjIAogICAgICAgIOOAgFszLjNdIOiogOiqnu+8miBDIAogICAgICAgIFs0XSDmnJ/pmZA6MTIvMTEgCiAgICAgICAg44Od44Kk44Oz44K/44O844Gv5L2/44KP44Ga44Gr44KI44KN44GX44GP44GK6aGY44GE44GE44Gf44GX44G+44GZIAogICAgMi4KKi8KI2luY2x1ZGU8c3RkaW8uaD4KCmRvdWJsZSBpbnBybyhkb3VibGUgYVtdLCBkb3VibGUgYltdLCBpbnQgbikKewogICAgaW50IGk7CiAgICBkb3VibGUgczsKICAgIHMgPSAwLjA7CiAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgcyArPSBhW2ldICogYltpXTsKICAgIH0KICAgIHJldHVybiBzOwp9CgppbnQgbWFpbigpCnsKICAgIGRvdWJsZSBhW10gPSB7IDEuMCwgMi4wLCAzLjAgfTsKICAgIGRvdWJsZSBiW10gPSB7IDMuMCwgMi4wLCAxLjAgfTsKICAgIGludCBpOwogICAgaW50IG4gPSBzaXplb2YoYSkgLyBzaXplb2YoZG91YmxlKTsKCiAgICBwcmludGYoImFbXSA9IHsgIik7CiAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgcHJpbnRmKCIlZiAiLCBhW2ldKTsKICAgIH0KICAgIHByaW50ZigifVxuIik7CiAgICBwcmludGYoImJbXSA9IHsgIik7CiAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgcHJpbnRmKCIlZiAiLCBiW2ldKTsKICAgIH0KICAgIHByaW50ZigifVxuIik7CgogICAgcHJpbnRmKCJpbnBybyhhLCBiLCAlZCkgPSAlZlxuIiwgbiwgaW5wcm8oYSwgYiwgbikpOwp9