-
Notifications
You must be signed in to change notification settings - Fork 0
/
Find.cpp
107 lines (101 loc) · 1.87 KB
/
Find.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#include "Account.h"
#include "AccountData.h"
int IndexFind(vector<Account>& data)
{
cout << "怀唗瘍" << endl;
int index;
cin >> index;
int adjuge = 0;
for (int i = 0; i < data.size(); i++)
{
Account account = data[i];
if (account.GetIndex() == index)
{
adjuge = account.GetIndex();
}
}
if (!adjuge)
{
cout << "帤梑善醴梓梖等" << endl;
system("pause");
}
return adjuge;
}
int DateFind(vector<Account>& data)
{
system("cls");
cout << "怀" << endl;
int date;
cin >> date;
int adjuge = 0;
for (int i = 0; i < data.size(); i++)
{
Account account = data[i];
if (account.GetDate() == date)
{
Print(data[i]);
adjuge++;
}
}
if (!adjuge)
cout << "帤梑善醴梓梖等" << endl;
system("pause");
return adjuge;
}
int NameFind(vector<Account>& data)
{
system("cls");
cout << "怀靡備" << endl;
string name;
cin >> name;
int adjuge = 0;
for (int i = 0; i < data.size(); i++)
{
Account account = data[i];
if (account.GetName() == name)
{
Print(data[i]);
adjuge++;
}
}
if (!adjuge)
cout << "帤梑善醴梓梖等" << endl;
system("pause");
return adjuge;
}
int AmountFind(vector<Account>& data)
{
system("cls");
cout << "怀踢塗" << endl;
int amount;
cin >> amount;
int adjuge = 0;
for (int i = 0; i < data.size(); i++)
{
Account account = data[i];
if (account.GetAmount() == amount)
{
Print(data[i]);
adjuge++;
}
}
if (!adjuge)
cout << "帤梑善醴梓梖等" << endl;
system("pause");
return adjuge;
}
void PrintFind(int index, vector<Account>& data)
{
for (int i = 1; i < data.size(); i++)
{
Account account = data[i];
if (account.GetIndex() == index)
{
Print(data[i]);
}
}
}
void Print(Account account)
{
cout << account.GetIndex() << ". 靡備: " << account.GetName() << " 踢塗: " << account.GetType() << account.GetAmount() << " : " << account.GetDate() << " 掘蛁: " << account.GetNote() << endl;
}