您的位置:首页 > 其它

【LVL1_5_c】【课后练习】【3】 求两个数组的对应元素之和。

2015-12-26 16:23 246 查看
// ConsoleApplication2.cpp : 定义控制台应用程序的入口

#include "stdafx.h"
#include <cmath>
#include<stdlib.h>

int _tmain(int argc, _TCHAR* argv[])
{
int a[5] = {1,2,3,4,5};
int b[5] = {11,4,2,7,9};
int c[5] = { 0 };

int acc;
for (acc = 0; acc < 5; acc++)
{
c[acc] = a[acc] + b[acc];
printf("%d\n", c[acc]);

}
system("pause");
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: