, , , , , . .

 

 

!

 

:

:

 

 

 

?

StudentHelp, , MS Word. , , antiplagiat.ru, etxt.ru advego.ru. StudentHelp , Word .


:


++ METRO

:

: . : 15.05.2012. : 2011. : 14. antiplagiat.ru: < 30%

():












































2011



++ METRO.
, , , , , . , -, .

































1) 腅.4
2) 5
3) - 6-10
5) 11-15
6) 16
7) 17
8) : ..18-22




































1.
METRO, :

:
. :
    ( );
    ( );
    ( );
    ( );
    ( );
    ( ) ;
    ( ).



























2.
:
struct metro char naim[l];
char rl[l];
int year;
int pr;
int kol;
- -
-
-
-
-



:
inputfile()
output()
outputfile()
addmetro()
deletemetro()
sort_naim()
sort_kol()
poisk_naim();
poisk_ng();









3.-
1.- :














































-

+



2.




+

-








3.








-









4.



+















5.








+

-




-

+

_

+

6. C








+




-

+





7. :








_

+
_

+







    :








_

+
_

+






9. :
























4.
1. , 10 :
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.


1. .


2. . :


2. .





metro.txt :

3. metro.txt
3. . 2 :

4.







4. 3 , , ( metro2.txt)

5.
5. . , 4 :
6.
6. . 5 :
7.












7. .
6 .


8.

9. . 7 :



9.

10. . .


10.
11. . 9 , . , :

11.
10 .
Enter .






























, . , . , .
.
































    . . ++, 3- . . - .: "", .: " ", 1999. - 991 ., .
    .. . .. /C++. . .: ,2007. 461 .: .
    . - C++. 2 . , 2007. - 336 .: .
    .. , .. . /C++. : . .: , 2007. 239 .: .



































:
#include<iostream.h>
#include<fstream.h>
#include<string.h>
#include<stdlib.h>
#include<conio.h>
#include<iomanip.h>
const int l=31;

struct metro
{char naim[l], rl[l];
int year, pr, kol;
};


const int N=100;
class mosk_metro
{private:
metro x[N];
int n;
public:
void outputfile();
void inputfile();
void addmetro();
void deletemetro();
void output();
void sort_naim();
void sort_kol();
void poisk_naim();
void poisk_ng();
};


void mosk_metro:: inputfile()
{ifstream fin;
char file[l];
cout<<"Imia faila:"; cin>>file;
fin.open(file);
if(fin==NULL) {cout<<"Not open.\n"; getch(); exit(1);}
n=0;
do{fin>>x[n].naim>>x[n].rl>>x[n].year
>>x[n].pr>>x[n].kol;
n++;
}while(fin.good());
n--;
cout<<"Fail vveden.\n"; getch();
fin.close();
}

void mosk_metro:: output()
{ int i;
cout<<"\n-------------------------------------------------------------------------------\n";
cout<<"\n| NAIMENOVANIE | RAION LINII |GOD PUSKA|PROTIAZENNOST'| KOL POEZDOV |\n";
cout<<"\n-------------------------------------------------------------------------------\n";
for(i=0;i<n;i++)
{cout<<setw(24)<<setiosflags(ios::left)<<x[i].naim
<<setw(17)<<setiosflags(ios::left)<<x[i].rl
<<setw(13)<<setiosflags(ios::left)<<x[i].year
<<setw(16)<<setiosflags(ios::left)<<x[i].pr
<<setw(15)<<setiosflags(ios::left)<<x[i].kol<<endl;
if((i+1)%10==0) getch();
}
cout<<"\n------------------------------------------------------------------------------\n";
getch();
}

void mosk_metro:: addmetro()
{ metro t;
if(n==N) {cout<<"Massiv perepolnen.\n"; getch(); exit(0);}
cout<<"Naimenovanie:"; cin>>t.naim;
cout<<"Raion linii:"; cin>>t.rl;
cout<<"God puska:"; cin>>t.year;
cout<<"Protiazennost':"; cin>>t.pr;
cout<<"Kol-vo poezdov:"; cin>>t.kol;
x[n]=t; n++;
cout<<"Zapis' dobavlena.\n";
getch();
}

void mosk_metro:: deletemetro()
{char ch;
int i,j;
output();
cout<<"Nomer udalennoi stroki:";
cin>>j;
if(j<1||j>n) {cout<<"Net takoi stroki.\n"; getch(); exit(0);}
cout<<setw(20)<<x[j-1].naim<<endl;
cout<<"Udalit?(y/n):"; cin>>ch;
if(ch=='y')
{for(i=j;i<n;i++)
x[i-1]=x[i];
n--;
}
cout<<"Zapis' udalena.\n"; getch();
}

void mosk_metro:: outputfile()
{ofstream out;
char file[l];
int i;
cout<<"imya faila:";
cin>>file;
out.open(file);
if (out==NULL) {cout<<"Ne naiden"; getch(); exit(1);}
for(i=0;i<n;i++)
{out<<setw(24)<<setiosflags(ios::left)<<x[i].naim
<<setw(17)<<setiosflags(ios::left)<<x[i].rl
<<setw(13)<<setiosflags(ios::left)<<x[i].year
<<setw(16)<<setiosflags(ios::left)<<x[i].pr
<<setw(15)<<setiosflags(ios::left)<<x[i].kol<<endl;}
out.close();
cout<<"Fail sohranen"; getch();
}

void mosk_metro:: sort_kol()
{int i,fl,nn;
metro t;
nn=n;
do{fl=0;nn--;
for(i=0;i<nn;i++)
if(x[i].kol>x[i+1].kol)
{t=x[i];
x[i]=x[i+1];
x[i+1]=t;
fl=1;}
}while(fl==1);
}


void mosk_metro:: sort_naim()
{int i,fl,nn;
metro t;
nn=n;
do {fl=0; nn--;
for(i=0;i<nn;i++)
if(strcmp(x[i].naim,x[i+1].naim)>0)
{t=x[i];
x[i]=x[i+1];
x[i+1]=t;
fl=1;}
}while(fl==1);
}


void mosk_metro:: poisk_naim()
{int i;
char naim[l];
cout<<"Vvedite naimenovanie stancii:"; cin>>naim;
int f=0;
for(i=0;i<n;i++)
if(strcmp(x[i].naim,naim)==0)
{cout<<setw(3)<<i+1
<<setw(16)<<setiosflags(ios::left)<<x[i].naim
<<setw(15)<<setiosflags(ios::left)<<x[i].rl
<<setw(13)<<setiosflags(ios::left)<<x[i].year
<<setw(16)<<setiosflags(ios::left)<<x[i].pr
<<setw(15)<<setiosflags(ios::left)<<x[i].kol<<endl;
f++;
}getch();
..................



90% antiplagiat.ru, etxt.ru advego.ru




* . , .