y‰SŽÒнŒ}zC/C++Ž ..
87:ƒfƒtƒHƒ‹ƒg‚Ì–¼–³‚µ‚³‚ñ
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);
}
ŽŸƒy[ƒWÅVƒŒƒX•\ަƒXƒŒƒbƒh‚ÌŒŸõ—ÞŽ—ƒXƒŒˆê——˜b‘è‚̃jƒ…[ƒX‚¨‚Ü‚©‚¹ƒŠƒXƒg¥ƒIƒvƒVƒ‡ƒ“‚ð•\ަ‰É‚‚Ԃµ2ch
4865“ú‘O‚ÉXV/60 KB
’S“–:undef