#include <iostream>
using namespace std;
#define N 5
int main(int argc, char** argv)
{
int data[N] = { 1,2,3,4,5 };
int newdata = 6;
int position = 3;
int i;
for (i = N - 1; i >= position; i--)
data[i] = data[i - 1];
data[i] = newdata;
for (int i = 0; i < N; i++)
{
cout << data[i] << " ";
}
cout << endl;
return 0;
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น