35657

Untitled

Jan 13th, 2024
1,376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <Windows.h> // нужна для работы SetConsole
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8.     SetConsoleCP(1251); // установка кодировки 1251 в поток ввода
  9.     SetConsoleOutputCP(1251); // установка кодировки 1251 в поток вывода
  10.    
  11.     char line[40];
  12.     gets_s(line);
  13.     int num = strlen(line);
  14.     cout << "Занято: " << num + 1 << " Свободно: " << 40 - num - 1 << endl;
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment