1 solutions

  • 0
    @ 2023-1-17 22:26:23
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a[25]={0}, n, x, y;
    	cin >> n;
    	for(int i = 1; i <= n; i++){
    		cin >> a[i];
    	}
    	cin >> x >> y;
    	for(int i = n; i >= x; i--){
    		a[i+1] = a[i];
    	}
    	a[x] = y;
    	for(int i = 1; i <= n+1; i++){
    		cout << a[i] << " ";
    	}
    	return 0;
    }
    
    
    
    • 1

    Information

    ID
    551
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    9
    Tags
    # Submissions
    9
    Accepted
    6
    Uploaded By