Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab6_218

Snippet info

Language

Cpp

Visibility

public

Author

maloy-

Created

2018-12-11T19:43:16Z

Updated

2018-12-11T23:27:20Z

#include <iostream>
using namespace std;
#include <cmath>
int main() {
    const int n = 25 ; 
    int a[n] , b[n] ,q=1 ;
    for (size_t i = 0 ; i < n ; i++){
        a[i] = 150 + pow(q,2); 
        //cout << " [ " << i+1 << " ] = " << a[i] << endl  ;
        cout << a[i] << " " ;
        b[i] = a[i] ; 
        q++;
    }
    
    int x1, y1;
    cin >> x1 >> y1 ; 
    
    cout << endl << "1й = " << x1 << endl ; 
    cout << "2й = " << y1 << endl ; 
    int x=0 ;
    for (size_t i = 0 ; i < n ; i++){
        if (i+1 == x1){
            x = i+2 ; 
            for (size_t j = i ; j < n-1 ; j++){
                b[j] = a[x];
                x++;
                
            }
        }
        if (i+1 == x1){
            x = i+2 ;
            for (size_t j = i ; j < n-1; j++){
                b[j] = a[x];
                x++;
            }
        }
        
        
    }
    
    for (size_t i = 0 ; i < n-2 ; i++){
        //cout << " [ " << i+1 << " ] = " << a[i] << endl  ;
        cout << b[i] << " " ;
    }
    
    return 0;
}
INFO