Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h> // нужна для работы SetConsole
- using namespace std;
- int main() {
- SetConsoleCP(1251); // установка кодировки 1251 в поток ввода
- SetConsoleOutputCP(1251); // установка кодировки 1251 в поток вывода
- char line[40];
- gets_s(line);
- int num = strlen(line);
- cout << "Занято: " << num + 1 << " Свободно: " << 40 - num - 1 << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment