Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <clocale>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Rus");
- string s = "Программа";
- const int len = s.length();
- for (int i = 1; i<len; i += 2)
- {
- cout << s[i];
- }
- for (int i = len % 2 ? len - 1 : len - 2; i >= 0; i -= 2)
- {
- cout << s[i];
- }
- cout << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment