Ruslan_Isaev

KatyaCPP

Jun 14th, 2021 (edited)
125
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<fstream>
  3. #include<string>
  4. #include<iomanip>
  5. using namespace std;
  6.  
  7. int main() {
  8.     setlocale(LC_ALL, "Russian");
  9.     cout << "Введите строку :";
  10.     string Stroka;
  11.     cin >> Stroka;
  12.     const int n = Stroka.length();
  13.     char* Array = (char*)Stroka.c_str();
  14.     char* Array1 = (char*)Stroka.c_str();
  15.     for (int i = 0; i < n; i++)
  16.     {
  17.         //cout << Stroka[i] << " ";
  18.         //memset(((&Array)+i),Stroka.c_str()[i],1);
  19.         Array[i] = Stroka[i];
  20.         // cout << Array[i] << " ";
  21.     }
  22.     //shifr(Array1,Array, n);
  23.     for (int i = 0; i < n; i++)
  24.     {
  25.         cout << Array1[i] << endl;
  26.     }
  27.     cout << "Длина = " << n << endl;
  28.     cout << "Строка = " << Stroka << endl;
  29.     system("pause");
  30.     return 0;
  31. }
RAW Paste Data