Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <clocale>
- #include <iostream>
- #include <stdlib.h>
- #include <iomanip>
- #include <string>
- using namespace std;
- struct List{
- CarInfo car;
- OwnerInfo man;
- JobInfo work;
- AddressInfo home;
- };
- int menu(){
- int menu_number;
- cout << " МЕНЮ" << endl;
- cout << "> 1.Формирование массива <" << endl;
- cout << "> 2.Добавить данные в массив <" << endl;
- cout << "> 3.Печать данных <" << endl;
- cout << "> 4.Выход <";
- cout << endl;
- cin >> menu_number;
- return menu_number;
- }
- int array(){
- int n;
- cout << "Введите кол-во людей: ";
- cin >> n;
- for (int i = 0; i < n; i++){
- cout << "Информация об автомобиле: " << endl;
- cin.getline(list[i].CarInfo, 50);
- cout << "Информация о владельце: " << endl;
- cout << "Сведения о работе: " << endl;
- cout << "Адрес владельца: " << endl;
- }
- return 0;
- }
- void table(int n){
- cout << endl;
- cout << " №" << " | " << "Владелец" << " | " << "Автомобиль" << " | " << "Сведения о работе" << " | " << "Адрес владельца" << endl;
- cout << "-----------------------------------------------------------------" << endl;
- for (int i = 0; i < n; i++){
- cout << i + 1 << " " << list[i]. << list[i].Name << " " << a[i].CarNumber << a[i].CarBrand << a[i].Color << " " << a[i].PlaceOfWork << a[i].Position << " " << a[i].City << a[i].Street << a[i].HouseNumber << a[i].Apartment;
- }
- }
- struct CarInfo{
- char CarNumber[6];
- char CarBrand[20];
- char Color[20];
- };
- struct OwnerInfo{
- char Surname[30];
- char Name[30];
- };
- struct JobInfo{
- char PlaceOfWork[30];
- char Position[30];
- };
- struct AddressInfo{
- char City[30];
- char Street[30];
- int HouseNumber;
- int Apartment;
- };
- int _tmain(int argc, _TCHAR* argv[])
- {
- setlocale(LC_ALL, "rus");
- List list[30] = {};
- int n;
- int m = menu();
- while (m != 4){
- switch (m){
- case 1:array(); break;
- //cout << "Введите кол-во людей" <<endl ;
- //cin >> n;
- case 2:break;
- case 3:table(n); break;
- case 4: break;
- }
- m = menu();
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement