Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct Mail
- {
- char sender[50];
- int date;
- char text[200];
- int risk;
- };
- struct Inbox
- {
- char destination[100];
- int nmails;
- Mail x[200];
- };
- void main()
- {
- Inbox y[20];
- for (int i = 0; i < 20; i++)
- {
- cout << "Enter the destination:" << endl;
- gets_s(y[i].destination);
- cout << "Enter the number of mails:" << endl;
- cin >> y[i].nmails;
- for (int j = 0; j < y[i].nmails; j++)
- {
- cout << "Enter the sender name:" << endl;
- gets_s(y[i].x[j].sender);
- cout << "Enter the text:" << endl;
- gets_s(y[i].x[j].text);
- cout << "Enter the date:" << endl;
- cin >> y[i].x[j].date;
- cout << "Enter the risk of virus attachment with the mail:" << endl;
- cin >> y[i].x[j].risk;
- }
- }
- int range1, range2;
- cout << "Enter a range of risk:" << endl;
- cin >> range1 >> range2;
- for (int i = 0; i < 20; i++)
- {
- for (int j = 0; j < y[i].nmails; j++)
- {
- if (y[i].x[j].risk >= range1 && y[i].x[j].risk <= range2)
- {
- cout << y[i].x[j].text;
- }
- }
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement