#include <iostream>
using namespace std;
int main ()
{
int n, t;
cin >> n >> t;
if (t%2==0)
{
int x;
for (int I=0; I<n; I++)
{
cin >>x;
cout <<x;
}
}
else{
int y[n];
for (int I=n-1; I>=0 ;I--)
cin >> y[I];
for (int I=0; I<n; I++)
cout << y[I];
}
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #include <iostream> using namespace std; int main () { int n, t; cin >> n >> t; if (t%2==0) { int x; for (int I=0; I<n; I++) { cin >>x; cout <<x; } } else{ int y[n]; for (int I=n-1; I>=0 ;I--) cin >> y[I]; for (int I=0; I<n; I++) cout << y[I]; } return 0; } |
English