h (); exit (0) ;: cout lt; lt; Net takogopunkta menu! n raquo ;; getch (); break;}
}
} :: inputfile ()
{ifstream fin; file [l]; lt; lt; File name: raquo ;; cin gt; gt; file; .open (file); (fin == NULL) {cout lt; lt; Does not open. n raquo ;; getch (); exit (1);}=0; {fin gt; gt; x [n] .po gt; gt; x [n] .pn gt; gt; x [n] .km gt; gt; x [n] .np; ++ ;
} while (fin.good ()); -; lt; lt; File was inputted. n raquo ;; getch () ;. close (); ();
} :: output ()
{ inti;lt;lt;laquo;n------------------------------------------------------------------------------raquo;;lt;lt;laquo;n| N | Punktotpravlenia | Punktnaznacheniya | Kolichestvomest | Nomerpoezda|nraquo;;lt;lt;laquo;------------------------------------------------------------------------------nraquo;;(i=0;ilt;n;i++)
{cout lt; lt; | lt; lt; setw (3) lt; lt; i + 1
lt;lt;laquo;|raquo;lt;lt;setw(19)lt;lt;setiosflags(ios::left)lt;lt;x[i].po
lt;lt;laquo;|raquo;lt;lt;setw(20)lt;lt;setiosflags(ios::left)lt;lt;x[i].pn
lt;lt;laquo;|raquo;lt;lt;setw(18)lt;lt;setiosflags(ios::left)lt;lt;x[i].km
lt;lt;laquo;|raquo;lt;lt;setw(13)lt;lt;setiosflags(ios::left)lt;lt;x[i].nplt;lt;laquo;|raquo;lt;lt;endl;
}lt;lt;laquo;------------------------------------------------------------------------------nraquo;;
} :: add ()
{train t; (n == N) {cout lt; lt; Massivperepolnen. n raquo ;; getch (); exit (0);} lt; lt; Punktotpravleniya: raquo ;; cin gt; gt; x [n] .po; lt; lt; Punktnaznacheniya: raquo ;; cin gt; gt; x [n] .pn; lt; lt; Kolichestvomest: raquo ;; cin gt; gt; x [n] .km; lt; lt; Nomerpoezda: raquo ;; cin gt; gt; x [n] .np; ++; lt; lt; Zapisdobavlena. n raquo ;; (); ();
} :: deletetrain ()
{charch;, j; (); lt; lt; Nomerudalennoistroki: raquo ;; gt; gt; j; (j lt; 1 || j gt; n) {cout lt; lt; laquo ; Net takoistroki. n raquo ;; getch (); exit (0);} lt; lt; setw (20) lt; lt; x [j - 1] .po lt; lt; endl; lt; lt; Udalit? (y/n): raquo ;; cin gt; gt; ch; (ch == y )
{for (i=j; i lt; n; i ++) [i - 1]=x [i]; -;
} lt; lt; Zapisudalena. n raquo ;; getch ();
} :: outputfile ()
{ofstream out; file [l] ;; lt; lt; File name: raquo ;; gt; gt; file; .open (file); (out == NULL) {cout lt ; lt; Ne naiden raquo ;; getch (); exit (1);} (i=0; i lt; n; i ++)
{out lt; lt; setw (22) lt; lt; setiosflags (ios :: left) lt; lt; x [i] .po
lt; lt; setw (25) lt; lt; setiosflags (ios :: left) lt; lt; x [i] .pn
lt; lt; setw (18) lt; lt; setiosflags (ios :: left) lt; lt; x [i] .km
lt;lt;setw(18)lt;lt;setiosflags(ios::left)lt;lt;x[i].nplt;lt;endl;}.close();lt;lt;laquo;Fail soxranen n raquo ;; getch ();
} :: sort_np ()
{intfl, nn; t;, ??j;, b; (i=0; i lt; n - 1; i ++)
{(j=i; j lt; n; j ++)
{(x [i] .np gt; x [j] .np) {t=x [i]; x [i]=x [j]; x [j]=t;}
}
} ();
}