#include <stdio.h>
// 配列要素を入れ替える関数
void swap(int *x, int *y) {
int temp = *x; // 一時的な変数に値を保存
*x = *y; // xの値をyにコピー
*y = temp; // 保存しておいたxの値をyにコピー
}
int main() {
int data1[5] = {1, 2, 3, 4, 5}; // 配列data1の宣言と初期化
int data2[5] = {6, 7, 8, 9, 10}; // 配列data2の宣言と初期化
for (int i = 0; i < 5; i++) {
}
for (int i = 0; i < 5; i++) {
}
// 配列の要素を入れ替える
for (int i = 0; i < 5; i++) {
swap(&data1[i], &data2[i]);
}
for (int i = 0; i < 5; i++) {
}
for (int i = 0; i < 5; i++) {
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgovLyDphY3liJfopoHntKDjgpLlhaXjgozmm7/jgYjjgovplqLmlbAKdm9pZCBzd2FwKGludCAqeCwgaW50ICp5KSB7CiAgICBpbnQgdGVtcCA9ICp4OyAvLyDkuIDmmYLnmoTjgarlpInmlbDjgavlgKTjgpLkv53lrZgKICAgICp4ID0gKnk7ICAgICAgIC8vIHjjga7lgKTjgpJ544Gr44Kz44OU44O8CiAgICAqeSA9IHRlbXA7ICAgICAvLyDkv53lrZjjgZfjgabjgYrjgYTjgZ9444Gu5YCk44KSeeOBq+OCs+ODlOODvAp9CgppbnQgbWFpbigpIHsKICAgIGludCBkYXRhMVs1XSA9IHsxLCAyLCAzLCA0LCA1fTsgLy8g6YWN5YiXZGF0YTHjga7lrqPoqIDjgajliJ3mnJ/ljJYKICAgIGludCBkYXRhMls1XSA9IHs2LCA3LCA4LCA5LCAxMH07IC8vIOmFjeWIl2RhdGEy44Gu5a6j6KiA44Go5Yid5pyf5YyWCgogICAgcHJpbnRmKCJCZWZvcmUgc3dhcHBpbmc6XG4iKTsKICAgIHByaW50ZigiZGF0YTE6ICIpOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCA1OyBpKyspIHsKICAgICAgICBwcmludGYoIiVkICIsIGRhdGExW2ldKTsKICAgIH0KICAgIHByaW50ZigiXG5kYXRhMjogIik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