Skip to content

Instantly share code, notes, and snippets.

@proffix4
Created November 18, 2023 11:27
Show Gist options
  • Save proffix4/ed7a4206c7f7fef387a4ac6bd512f174 to your computer and use it in GitHub Desktop.
Save proffix4/ed7a4206c7f7fef387a4ac6bd512f174 to your computer and use it in GitHub Desktop.
Cpp Console Linux example
#include <clocale>
#include <string>
#include <iostream>
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
string fio;
cout << "Введите строку: ";
cin >> fio;
cout << "Вы ввели: " << fio << endl;
cout << "Размер строки: " << fio.length() << endl;
for (int i = 0; i < fio.length(); i++) {
cout << "[" << i << "]: " << fio[i] << " (code: " << int(fio[i]) << ")" << endl;
}
cout << '\n' << "Press the 'q' and Enter key to continue";
do {
} while (cin.get() != 'q');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment