Advertisement
Arishaa_i

Untitled

Mar 25th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. cout << "Введите строку для проверки на буквы: " << endl;
  2.  
  3.     char l[500];
  4.     gets_s(l, 500);
  5.     int y = 0;
  6.     int p = 0;
  7.  
  8.     while (l[y])
  9.     {
  10.         if (isalpha(l[y]))
  11.         {
  12.             p++;
  13.         }
  14.         y++;
  15.     }
  16.     if (y == p)
  17.     {
  18.         cout << "Вся строка состоит из букв." << endl;
  19.     }
  20.     else
  21.     {
  22.         cout << "Не все символы строки являются буквами." << endl;
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement