/
AirLexa
/
03
Обзор
Документация
Войти
/
AirLexa
/
03
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Lesson_06/Task_1/Task_1.cpp
28 строк
656 B
AirLexa
загрузка Lesson_06/Task_1/Task_1.cpp
20 янв 2026, 22:29
Верифицирован
20 янв 2026, 22:29
9b77b7b
Код
Авторство
О чём код?
#include <iostream> #include <string> #include <windows.h> int simple_string_hash(std::string &s) { int res = 0; for (char c : s) res += c; return res; } int main() { SetConsoleCP(1251); SetConsoleOutputCP(1251); std::string word = ""; while (word != "exit") { std::cout << "Введите строку: "; getline(std::cin, word); std::cout << "Наивный хэш строки \"" << word << "\" = " << simple_string_hash(word) << std::endl; } std::cout << "До свидания! До новых встреч!" << std::endl; return 0; }