Created
November 18, 2023 11:27
-
-
Save proffix4/ed7a4206c7f7fef387a4ac6bd512f174 to your computer and use it in GitHub Desktop.
Cpp Console Linux example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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