/
AirLexa
/
origin
Обзор
Документация
Войти
/
AirLexa
/
origin
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
Lesson_02/Task_3/Task_3.cpp
41 строка
1 KB
AirLexa
добавил Lesson_02/Task_3/Task_3.cpp
22 окт 2025, 11:15
22 окт 2025, 11:15
791ed56
Код
Авторство
О чём код?
#include <iostream> #include <string> #include <windows.h> struct address { std::string town; std::string street; int house; int flat; int number; }; void print_address(address& a) { std::cout << "Город: " << a.town << std::endl; std::cout << "Улица: " << a.street << std::endl; std::cout << "Номер дома: " << a.house << std::endl; std::cout << "Номер квартиры: " << a.flat << std::endl; std::cout << "Индекс: " << a.number << std::endl << std::endl; } int main() { SetConsoleCP(1251); SetConsoleOutputCP(1251); address* ad = new address[5] { { "Москва", "Арбат", 12, 8, 123456 }, { "Ижевск", "Пушкина", 59, 143, 953769 }, { "Таганрог", "Свободы", 34, 28, 347923} , { "Брянск", "Дружбы", 22, 5, 234025 }, { "Санкт-Петербург", "Лиговский", 38, 57, 451908 } }; for (int i = 0; i < 5; i++) print_address(ad[i]); delete[] ad; return 0; }