【初心者歓迎】C/C++室 Ver.50【環境依存OK】
at TECH
87:デフォルトの名無しさん
08/03/15 23:31:58
>>85
#include <iostream>
void add(int* x, const int* y, int size) {
for(int i = 0; i < size; ++i) {
x[i] += y[i];
}
}
void show(const int* x, int size) {
for(int i = 0; i < size; ++i) {
std::cout << x[i] << ", ";
}
std::cout << std::endl;
}
int main() {
int a[5] = { 1, 2, 3, 4, 5 };
int b[5] = { 5, 4, 3, 2, 1 };
add(a, b);
show(a);
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4863日前に更新/60 KB
担当:undef