AlexandrTalchuk

6.3.11

Jan 7th, 2020
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "pch.h"
  2. #include <iostream>
  3. using namespace std;
  4. void strochka(char *str, int length)
  5. {
  6.     int i;
  7.  
  8.     for ( i = 0; i < length; i++)
  9.     {
  10.         if (int(str[i]) == 97) str[i] = char(42);
  11.         if (str[i] >= '0' && str[i] <= '9')
  12.             str[i] = '#';
  13.     }
  14.     cout << str;
  15. }
  16.  
  17. int main()
  18. {
  19.     setlocale(LC_ALL, "RUS");
  20.     char stroka[256];
  21.     int n;
  22.     cout << "Введите строку из символов" << endl;
  23.     cin.getline(stroka, 256);
  24.     n = strlen(stroka);
  25.     cout << endl;
  26.     strochka(stroka,n);
  27.     system("pause");
  28.     return 0;
  29. }
RAW Paste Data