Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main(){
- setlocale(LC_ALL, "Russian");
- //// Введение
- cout << "Введите слово в строку S = ";
- char S[100];
- cin.getline(S, 100);
- cout << "Введите число N = ";
- int N;
- cin >> N;
- ////
- if (strlen(S) > N) {
- while (strlen(S) - 1 != N-1) {
- for (int i = 0; i < strlen(S); i++) {
- S[i] = S[i + 1];
- }
- }
- }
- int k = 0;
- if (strlen(S) < N) {
- while (strlen(S) + 1 != N) {
- for (int i = 0; i < strlen(S); i++) {
- k = strlen(S) - i;
- S[strlen(S) + i] = S[k];
- cout << S << endl;
- }
- S[k] = '.';
- }
- }
- cout << S << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement