#include
#include
#include
#include
#include
using namespace std;
struct COMPUTER
{
string Procesor;
long int Ram;
struct HDD
{
string Namt;
long int V_Ram;
long int V;
}hd;
string Monitor;
string Keyboard;
string Mouse;
void print()
{
cout
}
};
int main()
{
setlocale(LC_ALL, "ru");
int k = 1;
int tk;
cout
cin >> tk;
COMPUTER* pc = new COMPUTER[tk];
for (int i = 0; i < tk; i++)
{
cout
cout
cin >> pc[i].Procesor;
cout
cin >> pc[i].Ram;
cout
cin >> pc[i].hd.Namt;
cout
cin >> pc[i].hd.V_Ram;
cout
cin >> pc[i].hd.V;
cout
cin >> pc[i].Monitor;
cout
cin >> pc[i].Keyboard;
cout
cin >> pc[i].Mouse;
system("cls");
}
int tab = 0;
bool bMENU = true;
char ch_key;
while (bMENU)
{
if (tab == 0)
{
cout
cout
cout
switch ((ch_key = _getch()))
{
case '1':
tab = 1;
break;
case '2':
tab = 2;
break;
case 27:
bMENU = false;
cout
break;
default:
cout
break;
}
}
if (tab == 1)
{
system("cls");
string proc;
cout
cin >> proc;
for (int i = 0; i < tk; i++)
{
if (pc[i].Procesor == proc)
{
pc[i].print();
}
}
cout
cout
switch ((ch_key = _getch()))
{
case '0':
tab = 0;
break;
case 27:
bMENU = false;
cout
break;
default:
cout
break;
}
system("cls");
}
if (tab == 2)
{
struct COMPUTER tmp;
system("cls");
for (int i = 0; i < tk; i++) {
for (int j = i + 1; j < tk; j++) {
if (pc[i].hd.V_Ram > pc[j].hd.V_Ram) {
tmp = pc[j - 1];
pc[j - 1] = pc[j];
pc[j] = tmp; ;
}
}
}
for (int i = 0; i < tk; i++)
{
pc[i].print();
}
cout
cout
switch ((ch_key = _getch()))
{
case '0':
tab = 0;
break;
case 27:
bMENU = false;
cout
break;
default:
cout
break;
}
system("cls");
}
}
system("pause");
return 0;
}