Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace КР_Шпилев
- {
- сlass abstract {vagon}()
- class s_vagon{
- public string type;
- {
- public s_vagon (string typ) {type = typ;}
- }
- }
- class p_vagon{
- public string type;
- public bool sv;
- public bool tv;
- public p_vagon (string typ, bool is_tv, bool is_sv) {type = typ; sv = is_sv; tv = is_tv;}
- }
- class station{
- public string Name;
- public int X;
- public int Y;
- public station (string Name, bool x, bool y) {this.Name = Name; X = x; Y = y;}
- }
- class train{
- public int Number;
- public vagon v;
- public string station_out;
- public string station_in;
- public int time_out;
- public int time_in;
- public train (string stat_out, string stat_in, int Number, p_vagon v, int time_out, int time_in)
- {station_out = stat_out; station_in = stat_in; this.v = v; this.time_out = time_out; this.time_in = time_in;}
- }
- public string client_out (){
- while (true){
- bool prov = false;
- Console.Writeline ("Выберите из списка желаемую станцию отправления")
- for (int i = 0, i <= station.Length, i++)
- Console.WriteLine(station[i].Name);
- string s = Console.ReadLine();
- for (int i = 0, i <= station.Length, i++)
- if (s == station[i].Name) {
- prov = true; break;
- }
- if (prov) {rerutn s; break;}
- }
- }
- public string client_in (){
- while (true){
- bool prov = false;
- Console.Writeline ("Выберите из списка желаемую станцию отправления")
- for (int i = 0, i <= station.Length, i++)
- Console.WriteLine(station[i].Name);
- string s = Console.ReadLine();
- for (int i = 0, i <= station.Length, i++)
- if (s == station[i].Name) {
- prov = true; break;
- }
- if (prov) {return s; break;
- }
- }
- public bool tv_p (){
- while (true) {
- Console.WriteLine ("Желаете ли вы в поездке пользоваться телевизором? Введите <<Да>>, если хотите и <<Нет>> в противном случае");
- string s = Console.ReadLine();
- if (s = "Да") {return true; break;}
- if (s = "Нет") {return false; break;}
- }
- }
- public bool sv_p (){
- while (true) {
- Console.WriteLine ("Желаете ли вы в поездке пользоваться телефонной связью? Введите <<Да>>, если хотите и <<Нет>> в противном случае");
- string s = Console.ReadLine();
- if (s = "Да") {return true; break;}
- if (s = "Нет") {return false; break;}
- }
- }
- public string station_out (
- class Program
- {
- static void Main(string[] args)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement