35657

Untitled

Sep 17th, 2023
726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #define _CRT_SEQURE_NO_WARNINGS
  2.  
  3. #include <iostream>
  4.  
  5. #include <Windows.h> // нужна для работы SetConsole
  6.  
  7. using namespace std;
  8.  
  9.  
  10.  
  11. int main() {
  12.  
  13.     SetConsoleCP(1251); // установка кодировки в поток ввода
  14.     SetConsoleOutputCP(1251); // установка кодировки в поток вывода
  15.  
  16.     const int size = 100;
  17.  
  18.     char line[size];
  19.  
  20.     gets_s(line);
  21.  
  22.     int num = strlen(line) + 1;
  23.  
  24.     cout << "Занято: " << num << " элементов, свободно: " << size - num << " элементов" << endl;
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment