Add files via upload
This commit is contained in:
313
dingtuipiao.cpp
Normal file
313
dingtuipiao.cpp
Normal file
@@ -0,0 +1,313 @@
|
||||
#include<iostream>
|
||||
#include<fstream>
|
||||
#include<sm.h>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
void dingtuipiaoxitong()
|
||||
{
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD>붩<EFBFBD><EFBFBD>Ʊϵͳ***" << "<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>" << endl;
|
||||
cout << "1.<2E><>Ʊ" << endl;
|
||||
cout << "2.<2E><>Ʊ" << endl;
|
||||
cout << "3.<2E>˳<EFBFBD>ϵͳ" << endl;
|
||||
int xuanze;
|
||||
cin >> xuanze;
|
||||
if (xuanze >= 1 && xuanze <= 3)
|
||||
{
|
||||
switch (xuanze)
|
||||
{
|
||||
case 1:dingpiao();
|
||||
case 2:tuipiao();
|
||||
case 3:jinruxitong();
|
||||
}
|
||||
}
|
||||
else { cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"; }
|
||||
}
|
||||
void dingpiao()
|
||||
{
|
||||
int z1 ;
|
||||
z1 = 0;
|
||||
ifstream ifile;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary|ios::in);
|
||||
hangbanxinxi w;
|
||||
ifile.seekg(0, ios::end);
|
||||
int lenk = ifile.tellg() / sizeof(w);
|
||||
ifile.seekg(0, ios::beg);
|
||||
for (int i = 0; i < lenk; i++)
|
||||
{
|
||||
ifile.read((char*)&w, sizeof(w));
|
||||
cout << i + 1 << "," << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << w.hangbanhao << "<EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD>˾" << w.hangkonggongsi << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << w.banqi << "ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << w.shifachengshi << "<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << w.didachengshi << "<EFBFBD>ִﺽվ¥" << w.didahangzhanlou << "ʱ<EFBFBD><EFBFBD>" << w.shijian << "ͷ<EFBFBD>Ȳ<EFBFBD><EFBFBD><EFBFBD>" << w.toudengcangshu << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << w.gongwucangshu << "<EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>" << w.jingjicangshu << endl;
|
||||
}
|
||||
ifile.close();
|
||||
int q;//<2F><><EFBFBD>溽<EFBFBD><E6BABD><EFBFBD><EFBFBD>
|
||||
int i;
|
||||
int z; z = 0;//<2F><><EFBFBD>Һ<EFBFBD><D2BA><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>
|
||||
int z2; z2 = 0;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ȼ<EFBFBD>
|
||||
int riqi;//<2F><>ʼ<EFBFBD><CABC><EFBFBD>ڵ<EFBFBD>ת<EFBFBD><D7AA>
|
||||
hangbanxinxi a;
|
||||
ifile.open("mayuan.hangbanxinxi.txt", ios::binary|ios::in);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len = ifile.tellg();
|
||||
cout << len<<endl;
|
||||
int n = len / sizeof(hangbanxinxi);
|
||||
cout << n << endl;
|
||||
while (true)
|
||||
{
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> q;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
ifile.seekg(sizeof(a) * i);
|
||||
ifile.read((char*)&a, sizeof(a));
|
||||
if (a.hangbanhao == q) { z = 1; break; }
|
||||
|
||||
}
|
||||
if (z != 1) { cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"; }
|
||||
else { break; }
|
||||
}
|
||||
ifile.close();
|
||||
if (z == 1)
|
||||
{
|
||||
|
||||
cout << "<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << q << "<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cout << "<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>İ<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>" << a.banqi << endl;
|
||||
//<2F><>ʼƥ<CABC><C6A5><EFBFBD><EFBFBD><EFBFBD>ںͰ<DABA><CDB0><EFBFBD>
|
||||
while (true)
|
||||
{
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>" << "<EFBFBD><EFBFBD>ʽΪxxxx<EFBFBD><EFBFBD>xx<EFBFBD><EFBFBD>xx<EFBFBD>գ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><EFBFBD>ɣ<EFBFBD>" << endl;
|
||||
cin >> riqi;
|
||||
int year, month, day;
|
||||
year = riqi / 10000;
|
||||
month = riqi / 100 - year;
|
||||
day = riqi % 100;
|
||||
if (month == 1 || month == 2)
|
||||
{
|
||||
month += 12;
|
||||
--year;
|
||||
}
|
||||
int weekday;
|
||||
weekday = (day + 2 * month + 3 * (month + 1) / 5 + year + year / 4 - year / 100 + year / 400 + 1) % 7;//<2F><><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD>ɭ<EFBFBD><C9AD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
month -= 12;
|
||||
++year;
|
||||
int p = 0;//<2F><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int cun;//<2F><>a.<2E><><EFBFBD>ڵĴ洢
|
||||
cun = a.banqi;
|
||||
while (cun != 0)
|
||||
{
|
||||
cun = cun / 10;
|
||||
++p;
|
||||
}
|
||||
cun = a.banqi;
|
||||
for (int k = 0; k < p; k++)
|
||||
{
|
||||
int bencixingqishu;
|
||||
int xiaci = cun;
|
||||
bencixingqishu = xiaci;
|
||||
if (cun / 10 != 0) { bencixingqishu = cun / pow(10, p - (k + 1)); xiaci = cun - bencixingqishu * pow(10, p - (k + 1)); }//<2F>Ѱ<EFBFBD><D1B0><EFBFBD>ת<EFBFBD><D7AA>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
||||
else { bencixingqishu = cun % 10; }
|
||||
if ((weekday + 1) == bencixingqishu)
|
||||
{
|
||||
cout << "<EFBFBD>Ѿ<EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << riqi << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << q << "<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD>";
|
||||
z1 = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if (z1 == 0) { cout << "û<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl; }
|
||||
|
||||
else { break; }
|
||||
|
||||
}
|
||||
dingdanmingxixinxi b;
|
||||
dingdanmingxixinxi c;
|
||||
int toudengcangshuliang = 0;
|
||||
int gongwucangshuliang = 0;
|
||||
int jingjicangshuliang = 0;
|
||||
ofstream ofile;
|
||||
ofile.open("mayuan.dingdan.txt", ios::out | ios::binary|ios::app);
|
||||
ofile.close();
|
||||
ifstream ifile;
|
||||
ifile.open("mayuan.dingdan.txt", ios::in | ios::binary);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len1 = ifile.tellg();
|
||||
int n1 = len1 / sizeof(dingdanmingxixinxi);
|
||||
for (int k = 0; k < n1; k++)
|
||||
{
|
||||
ifile.seekg(sizeof(dingdanmingxixinxi) * k);
|
||||
ifile.read((char*)&b, sizeof(dingdanmingxixinxi));
|
||||
|
||||
if (b.zuoweidengji == "toudengcang")
|
||||
{
|
||||
toudengcangshuliang += 1;
|
||||
}
|
||||
if (b.zuoweidengji == "gongwucang")
|
||||
{
|
||||
gongwucangshuliang += 1;
|
||||
}
|
||||
if (b.zuoweidengji == "jingjicang")
|
||||
{
|
||||
jingjicangshuliang += 1;
|
||||
}
|
||||
}
|
||||
ifile.close();
|
||||
cout << "<EFBFBD>Ѿ<EFBFBD>Ϊ<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << q << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << riqi << "<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cout << "<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>Ȳ<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>" << a.toudengcangshu << " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>" << a.gongwucangshu << " <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD>Ϊ<EFBFBD><CEAA>" << a.jingjicangshu << endl;
|
||||
cout << "<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>Ȳ<EFBFBD>ʣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << a.toudengcangshu - toudengcangshuliang << " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << a.gongwucangshu - gongwucangshuliang << " <20><><EFBFBD>ò<EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << a.jingjicangshu - jingjicangshuliang << endl;
|
||||
if (a.toudengcangshu - toudengcangshuliang != 0 && a.gongwucangshu - gongwucangshuliang != 0 && a.jingjicangshu - jingjicangshuliang != 0)
|
||||
{
|
||||
cout << "<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ȼ<EFBFBD>" << endl;
|
||||
cout << "1.ͷ<>Ȳ<EFBFBD>" << endl;
|
||||
cout << "2.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cout << "3.<2E><><EFBFBD>ò<EFBFBD>" << endl;
|
||||
int r;
|
||||
cin >> r;
|
||||
while (true)
|
||||
{
|
||||
switch (r)
|
||||
{
|
||||
case 1:if (a.toudengcangshu - toudengcangshuliang == 0) { cout << "ͷ<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><EFBFBD>λ<EFBFBD>ȼ<EFBFBD>" << endl; break; }
|
||||
else { z2 = 1; c.zuoweidengji = "toudengcang"; break; }
|
||||
case 2:if (a.gongwucangshu - toudengcangshuliang == 0) { cout << "<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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ȼ<EFBFBD>" << endl; break; }
|
||||
else { z2 = 1; c.zuoweidengji = "gongwucang"; break; }
|
||||
case 3:if (a.jingjicangshu - jingjicangshuliang == 0) { cout << "<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><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ȼ<EFBFBD>" << endl; break; }
|
||||
else { z2 = 1; c.zuoweidengji = "jingjicang"; break; }
|
||||
}
|
||||
if (z2 == 1) { break; }
|
||||
}
|
||||
if (z2 == 1)
|
||||
{
|
||||
cout << "<EFBFBD><EFBFBD>Ʊ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> c.chengkexingming;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
cin >> c.dianhuahaoma;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>" << endl;
|
||||
cin >> c.shenfenzhenghao;
|
||||
c.chufariqi = riqi;
|
||||
c.hangbanhao = q;
|
||||
ifile.open("mayuan.dingdan.txt", ios::in | ios::binary);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len1 = ifile.tellg();
|
||||
int n1 = len1 / sizeof(dingdanmingxixinxi);
|
||||
c.dingdanhao = 220 + n1;
|
||||
ifile.close();
|
||||
ofile.open("mayuan.dingdan.txt", ios::app | ios::binary |ios::out);
|
||||
ofile.write((char*)&c, sizeof(c));
|
||||
ofile.close();
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡" << endl;
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>" << c.dingdanhao;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "<EFBFBD>ܱ<EFBFBD>Ǹ" << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << q << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" << riqi << "<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD>" << "<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
}
|
||||
}
|
||||
dingtuipiaoxitong();
|
||||
|
||||
}
|
||||
void tuipiao()
|
||||
{
|
||||
cout << "<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><EFBFBD>" << endl;
|
||||
long long int shenfenzheng;
|
||||
cin >> shenfenzheng;
|
||||
int n = 0;//<2F><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD>
|
||||
dingdanmingxixinxi a;
|
||||
dingdanmingxixinxi b;
|
||||
ifstream ifile;
|
||||
ifile.open("mayuan.dingdan.txt", ios::binary);
|
||||
ifile.seekg(0, ios::end);
|
||||
int len2 = ifile.tellg();
|
||||
int u = len2 / sizeof(dingdanmingxixinxi);
|
||||
ofstream ofile;
|
||||
ofile.open("mayuan.dingdan1.txt", ios::binary | ios::out|ios::app);
|
||||
for (int i = 0; i < u; i++)
|
||||
{
|
||||
ifile.seekg(sizeof(a) * i);
|
||||
ifile.read((char*)&a, sizeof(a));
|
||||
if (shenfenzheng == a.shenfenzhenghao)
|
||||
{
|
||||
cout << "dingdanhao<EFBFBD><EFBFBD>" << a.dingdanhao;
|
||||
b.dingdanhao = a.dingdanhao;
|
||||
b.hangbanhao = a.hangbanhao;
|
||||
b.chufariqi = a.chufariqi;
|
||||
b.zuoweidengji = a.zuoweidengji;
|
||||
b.chengkexingming = a.chengkexingming;
|
||||
b.shenfenzhenghao = a.shenfenzhenghao;
|
||||
b.dianhuahaoma = a.dianhuahaoma;
|
||||
ofile.write((char*)&b, sizeof(b));
|
||||
++n;
|
||||
}
|
||||
}
|
||||
ifile.close();
|
||||
ofile.close();
|
||||
if (n == 0) { cout << "δ<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>Ϊ" << shenfenzheng << "<EFBFBD>ij˿<EFBFBD>" << endl; }
|
||||
else
|
||||
{
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>Ϊ" << shenfenzheng << "<EFBFBD>ij˿<EFBFBD>" << endl;
|
||||
ifile.open("mayuan.dindan1.txt", ios::binary | ios::in);
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
ifile.seekg(sizeof(a) * i);
|
||||
ifile.read((char*)&a, sizeof(a));
|
||||
cout << i + 1 << "." << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:" << a.dingdanhao << "<EFBFBD>˿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:" << a.chengkexingming << "<EFBFBD>绰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:" << a.dianhuahaoma << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:" << a.hangbanhao << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:" << a.chufariqi << "<EFBFBD><EFBFBD>λ<EFBFBD>ȼ<EFBFBD>Ϊ:" << a.zuoweidengji << endl;
|
||||
}
|
||||
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>Ʊ<EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
int dingdanhao;
|
||||
int y = 0;
|
||||
while (true)
|
||||
{
|
||||
cin >> dingdanhao;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
ifile.seekg(sizeof(a) * i);
|
||||
ifile.read((char*)&a, sizeof(a));
|
||||
if (dingdanhao == a.dingdanhao)
|
||||
{
|
||||
y =1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (y == 0) { cout << "δ<EFBFBD>ҵ<EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl; }
|
||||
else { break; }
|
||||
}
|
||||
ifile.close();
|
||||
ifile.open("mayuan.dingdan1.txt", ios::binary | ios::trunc);
|
||||
ifile.close();
|
||||
ofile.close();
|
||||
if (y == 1)
|
||||
{
|
||||
dingdanmingxixinxi a;
|
||||
ifile.open("mayuan.dingdan.txt", ios::binary);
|
||||
ofile.open("mayuan.dingdan2.txt", ios::trunc | ios::binary);
|
||||
ofile.close();
|
||||
ofile.open("mayuan.dingdan2.txt", ios::trunc | ios::out);
|
||||
for (int i = 0; i < u; i++)
|
||||
{
|
||||
ifile.seekg(sizeof(dingdanmingxixinxi) * i);
|
||||
ifile.read((char*)&a, sizeof(a));
|
||||
if (a.shenfenzhenghao != shenfenzheng && a.dingdanhao != dingdanhao)
|
||||
{
|
||||
ofile.write((char*)&a, sizeof(a));
|
||||
}
|
||||
}
|
||||
ifile.close();
|
||||
ofile.close();
|
||||
ifile.open("mayuan.dingdan2.txt", ios::binary);
|
||||
ofile.open("mayuan.dingdan.txt", ios::trunc | ios::binary);
|
||||
ofile.close();
|
||||
ofile.open("mayuan.dingdan.txt", ios::binary | ios::out);
|
||||
for (int i = 0; i < u - 1; i++)
|
||||
{
|
||||
ifile.seekg(sizeof(a) * i);
|
||||
ifile.read((char*)&a, sizeof(a));
|
||||
ofile.write((char*)&a, sizeof(a));
|
||||
}
|
||||
cout << "<EFBFBD><EFBFBD>Ʊ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>" << endl;
|
||||
ifile.close();
|
||||
ofile.close();
|
||||
ofile.open("mayuan.dingdan2.txt", ios::binary | ios::trunc);
|
||||
ofile.close();
|
||||
dingtuipiaoxitong();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user