Add files via upload
This commit is contained in:
393
hangban.cpp
Normal file
393
hangban.cpp
Normal file
@@ -0,0 +1,393 @@
|
||||
#include<iostream>
|
||||
#include<sm.h>
|
||||
#include<fstream>
|
||||
using namespace std;
|
||||
void hangbanguanlixitong()
|
||||
{
|
||||
|
||||
int xuanzegongneng;
|
||||
while (true)
|
||||
{
|
||||
cout << "<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD>ܣ<EFBFBD>" << endl;
|
||||
cout << "1.<2E><><EFBFBD>Ӻ<EFBFBD><D3BA><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>" << endl;
|
||||
cout << "2.<2E><>ʾ<EFBFBD><CABE><EFBFBD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>" << endl;
|
||||
cout << "3.<2E><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>" << endl;
|
||||
cout << "4.<2E>ĺ<DEB8><C4BA><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>" << endl;
|
||||
cout << "5.ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>" << endl;
|
||||
cout << "6.<2E>˳<EFBFBD>ϵͳ" << endl;
|
||||
cin >> xuanzegongneng;
|
||||
switch (xuanzegongneng)
|
||||
{
|
||||
case 1:tianjiahangbangongneng(); break;
|
||||
case 2:xianshisuoyouhangbanxinxigongneng(); break;
|
||||
case 3:chaxunhangbanxinxigongneng(); break;
|
||||
case 4:xiugaihangbanxinxigongneng(); break;
|
||||
case 5:shanchuhangbanxinxigongneng(); break;
|
||||
case 6:jinruxitong(); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void tianjiahangbangongneng()
|
||||
{
|
||||
hangbanxinxi a;
|
||||
hangbanxinxi b;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>a<EFBFBD>Աȶ<D4B1><C8B6><EFBFBD>
|
||||
while (true)
|
||||
{
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ӵĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.hangbanhao;
|
||||
ofstream ofile;
|
||||
ifstream ifile;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary | ios::in);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len = ifile.tellg();
|
||||
int n = len / sizeof(b);
|
||||
ifile.seekg(0, ios::beg);
|
||||
int jiance = 0;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
ifile.read((char*)&b, sizeof(b));
|
||||
if (b.hangbanhao == a.hangbanhao) { jiance = 1; }
|
||||
}
|
||||
ifile.close();
|
||||
if (jiance == 0) { break; }
|
||||
else { cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl; }
|
||||
}
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ӵĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD>չ<EFBFBD>˾" << endl;
|
||||
cin >> a.hangkonggongsi;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ӵĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>İ<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.banqi;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ӵĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.shifachengshi;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ӵĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.didachengshi;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ӵĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵִﺽվ¥" << endl;
|
||||
cin >> a.didahangzhanlou;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ӵĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.shijian;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ӵĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>Ȳ<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.toudengcangshu;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ӵĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.gongwucangshu;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ӵĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.jingjicangshu;
|
||||
ofstream ofile;
|
||||
ofile.open("mayuan.hangbanxinxi.txt", ios::binary | ios::app|ios::out);
|
||||
ofile.write((char*)&a, sizeof(a));
|
||||
ofile.close();
|
||||
hangbanguanlixitong();
|
||||
}
|
||||
void xianshisuoyouhangbanxinxigongneng()
|
||||
{
|
||||
hangbanxinxi b;
|
||||
ifstream ifile;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len = ifile.tellg();
|
||||
int n = len / sizeof(b);
|
||||
if (n == 0) { cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ" << endl; }
|
||||
else {
|
||||
ifile.seekg(0, ios::beg);
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
ifile.read((char*)&b, sizeof(b));
|
||||
cout << i + 1 << "," << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << b.hangbanhao << "<EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD>˾" << b.hangkonggongsi << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << b.banqi << "ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << b.shifachengshi << "<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << b.didachengshi << "<EFBFBD>ִﺽվ¥" << b.didahangzhanlou << "ʱ<EFBFBD><EFBFBD>" << b.shijian << "ͷ<EFBFBD>Ȳ<EFBFBD><EFBFBD><EFBFBD>" << b.toudengcangshu << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << b.gongwucangshu << "<EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>" << b.jingjicangshu << endl;
|
||||
}
|
||||
}
|
||||
ifile.close();
|
||||
hangbanguanlixitong();
|
||||
}
|
||||
void xianshisuoyouhangbanxinxigongnen()
|
||||
{
|
||||
hangbanxinxi b;
|
||||
ifstream ifile;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len = ifile.tellg();
|
||||
int n = len / sizeof(b);
|
||||
ifile.seekg(0, ios::beg);
|
||||
cout << n << endl;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
ifile.read((char*)&b, sizeof(b));
|
||||
cout << i + 1 << "," << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << b.hangbanhao << "<EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD>˾" << b.hangkonggongsi << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << b.banqi << "ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << b.shifachengshi << "<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << b.didachengshi << "<EFBFBD>ִﺽվ¥" << b.didahangzhanlou << "ʱ<EFBFBD><EFBFBD>" << b.shijian << "ͷ<EFBFBD>Ȳ<EFBFBD><EFBFBD><EFBFBD>" << b.toudengcangshu << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << b.gongwucangshu << "<EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>" << b.jingjicangshu << endl;
|
||||
}
|
||||
ifile.close();
|
||||
}
|
||||
void chaxunhangbanxinxigongneng()
|
||||
{
|
||||
int xuanze;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѯ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ" << endl;
|
||||
cout << "1.<2E><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD>Ų<EFBFBD>ѯ" << endl;
|
||||
cout << "2.<2E><><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD>ѯ" << endl;
|
||||
cin >> xuanze;
|
||||
switch (xuanze)
|
||||
{
|
||||
case 1:anzhaohangbanhaochaxun();
|
||||
case 2:anzhaoshifachengshichaxun();
|
||||
}
|
||||
hangbanguanlixitong();
|
||||
|
||||
}
|
||||
void anzhaohangbanhaochaxun()
|
||||
{
|
||||
hangbanxinxi a;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѯ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.hangbanhao;
|
||||
ifstream ifile;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len = ifile.tellg();
|
||||
int n = len / sizeof(hangbanxinxi);
|
||||
hangbanxinxi b;
|
||||
int c = 0;//<2F>ж<EFBFBD><D0B6><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>Ϣ<EFBFBD><CFA2>
|
||||
ifile.seekg(0, ios::beg);
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
ifile.read((char*)&b, sizeof(hangbanxinxi));
|
||||
if (a.hangbanhao == b.hangbanhao)
|
||||
{
|
||||
cout << "<EFBFBD>Ѳ<EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>" << endl;
|
||||
cout << "<EFBFBD>ú<EFBFBD><EFBFBD>ຽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.hangbanhao << "<EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD>˾" << b.hangkonggongsi << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.banqi << "ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.shifachengshi << "<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.didachengshi << "<EFBFBD>ִﺽվ¥Ϊ" << b.didahangzhanlou << "ʱ<EFBFBD><EFBFBD>Ϊ" << b.shijian << "ͷ<EFBFBD>Ȳ<EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.toudengcangshu << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.gongwucangshu << "<EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.jingjicangshu << endl;
|
||||
c = 1;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
if (c == 0) { cout << "<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ"; }
|
||||
ifile.close();
|
||||
hangbanguanlixitong();
|
||||
}
|
||||
void anzhaoshifachengshichaxun()
|
||||
{
|
||||
hangbanxinxi a;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѯ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.shifachengshi;
|
||||
ifstream ifile;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len = ifile.tellg();
|
||||
int n = len / sizeof(hangbanxinxi);
|
||||
hangbanxinxi b;
|
||||
int c = 0;
|
||||
ifile.seekg(0, ios::beg);
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
ifile.read((char*)&b, sizeof(hangbanxinxi));
|
||||
if (a.shifachengshi == b.shifachengshi)
|
||||
{
|
||||
cout << "<EFBFBD>Ѳ<EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>" << endl;
|
||||
cout << "<EFBFBD>ú<EFBFBD><EFBFBD>ຽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.hangbanhao << "<EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD>˾" << b.hangkonggongsi << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.banqi << "ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.shifachengshi << "<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.didachengshi << "<EFBFBD>ִﺽվ¥Ϊ" << b.didahangzhanlou << "ʱ<EFBFBD><EFBFBD>Ϊ" << b.shijian << "ͷ<EFBFBD>Ȳ<EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.toudengcangshu << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.gongwucangshu << "<EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.jingjicangshu << endl;
|
||||
c = 1;
|
||||
}
|
||||
}
|
||||
if (c == 0) { cout << "<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ"; }
|
||||
ifile.close();
|
||||
hangbanguanlixitong();
|
||||
}
|
||||
void xiugaihangbanxinxigongneng()
|
||||
{
|
||||
hangbanxinxi a;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.hangbanhao;
|
||||
hangbanxinxi b;
|
||||
ifstream ifile;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len = ifile.tellg();
|
||||
int n = len / sizeof(hangbanxinxi);
|
||||
int c; c = 0;//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
ifile.seekg(0, ios::beg);
|
||||
int i;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
ifile.read((char*)&b, sizeof(hangbanxinxi));
|
||||
if (b.hangbanhao == a.hangbanhao)
|
||||
{
|
||||
c = 1;
|
||||
cout << "<EFBFBD>Ѳ<EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>" << endl;
|
||||
cout << "<EFBFBD>ú<EFBFBD><EFBFBD>ຽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.hangbanhao << "<EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD>˾" << b.hangkonggongsi << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.banqi << "ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.shifachengshi << "<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.didachengshi << "<EFBFBD>ִﺽվ¥Ϊ" << b.didahangzhanlou << "ʱ<EFBFBD><EFBFBD>Ϊ" << b.shijian << "ͷ<EFBFBD>Ȳ<EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.toudengcangshu << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.gongwucangshu << "<EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>Ϊ" << b.jingjicangshu << endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ifile.close();
|
||||
if (c == 0) { cout << "δ<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD>" << endl; }
|
||||
else
|
||||
{
|
||||
hangbanxinxi c;
|
||||
hangbanxinxi d;
|
||||
int s = a.hangbanhao;
|
||||
int i;
|
||||
ifstream ifile;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len = ifile.tellg();
|
||||
int n = len / sizeof(hangbanxinxi);
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
ifile.seekg(sizeof(hangbanxinxi) * i);
|
||||
ifile.read((char*)&c, sizeof(hangbanxinxi));
|
||||
if (s == c.hangbanhao) { break; }
|
||||
}
|
||||
ifile.close();
|
||||
ofstream ofile;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary);
|
||||
ofile.open("mayuan.zhongjie.txt", ios::binary | ios::trunc);
|
||||
ofile.close();
|
||||
ofile.open("mayuan.zhongjie.txt", ios::binary | ios::out);
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
ifile.seekg(sizeof(hangbanxinxi) * j);
|
||||
ifile.read((char*)&c, sizeof(hangbanxinxi));
|
||||
if (j != i)
|
||||
{
|
||||
d.hangbanhao = c.hangbanhao;
|
||||
d.hangkonggongsi = c.hangkonggongsi;
|
||||
d.banqi = c.banqi;
|
||||
d.shifachengshi = c.shifachengshi;
|
||||
d.didachengshi = c.didachengshi;
|
||||
d.didahangzhanlou = c.didahangzhanlou;
|
||||
d.shijian = c.shijian;
|
||||
d.toudengcangshu = c.toudengcangshu;
|
||||
d.jingjicangshu = c.jingjicangshu;
|
||||
d.gongwucangshu = c.gongwucangshu;
|
||||
ofile.write((char*)&d, sizeof(hangbanxinxi));
|
||||
}
|
||||
}
|
||||
ifile.close();
|
||||
ofile.close();
|
||||
ifile.open("mayuan.zhongjie.txt", ios::binary);
|
||||
ofile.open("mayuan.hangbanxinxi.txt", ios::trunc);
|
||||
ofile.close();
|
||||
ofile.open("mayuan.hangbanxinxi.txt", ios::binary | ios::out | ios::app);
|
||||
for (int k = 0; k < n - 1; k++)
|
||||
{
|
||||
ifile.seekg(sizeof(hangbanxinxi) * k);
|
||||
ifile.read((char*)&d, sizeof(d));
|
||||
c.hangbanhao = d.hangbanhao;
|
||||
c.hangkonggongsi = d.hangkonggongsi;
|
||||
c.banqi = d.banqi;
|
||||
c.shifachengshi = d.shifachengshi;
|
||||
c.didachengshi = d.didachengshi;
|
||||
c.didahangzhanlou = d.didahangzhanlou;
|
||||
c.shijian =d.shijian;
|
||||
c.toudengcangshu = d.toudengcangshu;
|
||||
c.jingjicangshu = d.jingjicangshu;
|
||||
c.gongwucangshu = d.gongwucangshu;
|
||||
ofile.write((char*)&c, sizeof(c));
|
||||
}
|
||||
ifile.close();
|
||||
ofile.close();
|
||||
ofile.open("mayuan.zhongjie.txt", ios::trunc);
|
||||
ofile.close();
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ" << endl;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD>չ<EFBFBD>˾" << endl;
|
||||
cin >> a.hangkonggongsi;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>İ<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.banqi;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.shifachengshi;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.didachengshi;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵִﺽվ¥" << endl;
|
||||
cin >> a.didahangzhanlou;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.shijian;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>Ȳ<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.toudengcangshu;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.gongwucangshu;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> a.jingjicangshu;
|
||||
ofile.open("mayuan.hangbanxinxi.txt", ios::binary | ios::out|ios::app);
|
||||
ofile.write((char*)&a, sizeof(hangbanxinxi));
|
||||
ofile.close();
|
||||
cout << "<EFBFBD>ijɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>鿴<EFBFBD><EFBFBD>" << endl;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD>鿴<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0" << endl;
|
||||
int xuanze;
|
||||
cin >> xuanze;
|
||||
if (xuanze == 1) { xianshisuoyouhangbanxinxigongneng(); }
|
||||
else { ; }
|
||||
}
|
||||
hangbanguanlixitong();
|
||||
}
|
||||
void shanchuhangbanxinxigongneng()
|
||||
{
|
||||
hangbanxinxi a;
|
||||
hangbanxinxi b;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
int s;
|
||||
cin >> s;
|
||||
int z; z = 0;
|
||||
int i;
|
||||
ifstream ifile;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len = ifile.tellg();
|
||||
int n = len / sizeof(hangbanxinxi);
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
ifile.seekg(sizeof(hangbanxinxi) * i);
|
||||
ifile.read((char*)&a, sizeof(hangbanxinxi));
|
||||
if (s == a.hangbanhao) { z = 1; break; }
|
||||
}
|
||||
ifile.close();
|
||||
if (z == 0) { cout << "δ<EFBFBD>ҵ<EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD>" << endl; }
|
||||
else
|
||||
{
|
||||
ifstream ifile;
|
||||
ofstream ofile;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary);
|
||||
ofile.open("mayuan.zhongjie.txt",ios::binary| ios::trunc);
|
||||
ofile.close();
|
||||
ofile.open("mayuan.zhongjie.txt", ios::binary | ios::out);
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
ifile.seekg(sizeof(hangbanxinxi) * j);
|
||||
ifile.read((char*)&a, sizeof(hangbanxinxi));
|
||||
if (j != i)
|
||||
{
|
||||
b.hangbanhao = a.hangbanhao;
|
||||
b.hangkonggongsi = a.hangkonggongsi;
|
||||
b.banqi = a.banqi;
|
||||
b.shifachengshi = a.shifachengshi;
|
||||
b.didachengshi = a.didachengshi;
|
||||
b.didahangzhanlou = a.didahangzhanlou;
|
||||
b.shijian = a.shijian;
|
||||
b.toudengcangshu = a.toudengcangshu;
|
||||
b.jingjicangshu = a.jingjicangshu;
|
||||
b.gongwucangshu = a.gongwucangshu;
|
||||
ofile.write((char*)&b, sizeof(hangbanxinxi));
|
||||
}
|
||||
}
|
||||
ifile.close();
|
||||
ofile.close();
|
||||
ifile.open("mayuan.zhongjie.txt", ios::binary);
|
||||
ofile.open("mayuan.hangbanxinxi.txt", ios::trunc);
|
||||
ofile.close();
|
||||
ofile.open("mayuan.hangbanxinxi.txt", ios::binary | ios::out|ios::app);
|
||||
for (int k = 0; k < n - 1; k++)
|
||||
{
|
||||
ifile.seekg(sizeof(hangbanxinxi) * k);
|
||||
ifile.read((char*)&b, sizeof(b));
|
||||
a.hangbanhao = b.hangbanhao;
|
||||
a.hangkonggongsi = b.hangkonggongsi;
|
||||
a.banqi = b.banqi;
|
||||
a.shifachengshi = b.shifachengshi;
|
||||
a.didachengshi = b.didachengshi;
|
||||
a.didahangzhanlou = b.didahangzhanlou;
|
||||
a.shijian = b.shijian;
|
||||
a.toudengcangshu = b.toudengcangshu;
|
||||
a.jingjicangshu = b.jingjicangshu;
|
||||
a.gongwucangshu = b.gongwucangshu;
|
||||
ofile.write((char*)&a, sizeof(a));
|
||||
}
|
||||
ifile.close();
|
||||
ofile.close();
|
||||
ofile.open("mayuan.zhongjie.txt", ios::trunc);
|
||||
ofile.close();
|
||||
cout << "ɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
}
|
||||
hangbanguanlixitong();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user