eolymp
bolt
Try our new interface for solving problems
Problems

Делаем срезы

published at 10/19/16, 8:17:26 pm

Який 3 тест?

published at 3/25/18, 1:55:08 pm

Нормальний він -_-

published at 1/13/24, 1:02:58 pm

include <bits/stdc++.h>

define ll long long

define ld long double

using namespace std; int main(){

ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string n;
cin >> n;
cout << n[2] << endl
     << n[n.length() - 2] << endl
     << n.substr(0, 5) << endl
     << n.substr(0, n.length() - 2) << endl;
for (int i = 0; i < n.size(); i++)
    if (i % 2 == 0)
        cout << n[i];
cout << endl;

for (int i = 0; i < n.size(); i++)
    if (i % 2 == 1)
        cout << n[i];
cout << endl;

for (int i = n.size() - 1; i >= 0; i--)
    cout << n[i];
cout << endl;

for (int i = n.size() - 1; i >= 0; i--)
    if (i % 2 == (n.size() % 2 ? 0 : 1))
        cout << n[i];
cout << endl
     << n.size() << endl;

} //TECHNOBLADE NEVER DIE