Describe the structure named NOTE2, containing the fields: Name - last name and initials, TELE - phone number, DATE - date of birth (year, month, date).
Write a program that performs:
- input from the keyboard data in the array BLOCK2, consisting of 7 elements of type NOTE1, the records must be ordered by last name in alphabetical order;
- displaying information about a person whose last name was entered from the keyboard;
- if there is none, give a message.
Incorrectly displays the date of birth and telephone in the table, and also displays incorrect data for the last name after the table.
Tell me what is the error?
#include "stdafx.h" #include <iostream> #include <cstring> #include <conio.h> #include <cstdlib> #define M 15 #define N 7 #pragma warning(disable : 4996)// ΡΡΠΎΠ±Ρ ΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΎΡ Π½Π΅ ΡΡΠ³Π°Π»ΡΡ Π½Π° strcpy using namespace std; struct NOTE2 { char name[M]; int num; char date[M]; }; int main() { setlocale(0, "rus"); NOTE2 BLOCK2[N]; int i; for (i = 0; i < N; i++) { cout << "\nΠΠ²Π΅Π΄ΠΈΡΠ΅ ΠΈΠΌΡ: "; cin >> BLOCK2[i].name; cout << "\nΠΠ²Π΅Π΄ΠΈΡΠ΅ Π½ΠΎΠΌΠ΅Ρ ΡΠ΅Π»Π΅ΡΠΎΠ½Π°: "; cin >> BLOCK2[i].num; cout << "\nΠΠ²Π΅Π΄ΠΈΡΠ΅ Π΄Π°ΡΡ ΡΠΎΠΆΠ΄Π΅Π½ΠΈΡ: "; cin >> BLOCK2[i].date; } char cur[M]; for (i = 0; i<N - 1; i++) for (int j = i + 1; j<N; j++) if (strcmp(BLOCK2[i].name, BLOCK2[j].name)>0) { strcpy(cur, BLOCK2[i].name); strcpy(BLOCK2[i].name, BLOCK2[j].name); strcpy(BLOCK2[j].name, cur); } cout << "\n ________________________________________________________\n"; for (i = 0; i < N; i++) { cout << BLOCK2[i].name << " " << BLOCK2[i].num << " " << BLOCK2[i].date << endl; } cout << "\n ________________________________________________________\n"; char temp[M]; int count; while (strcmp(temp, "exit")) { cout << "\nΠΠ²Π΅Π΄ΠΈΡΠ΅ ΡΠ°ΠΌΠΈΠ»ΠΈΡ: "; cin >> temp; count = 0; for (i = 0; i < N; i++) { if (strcmp(BLOCK2[i].date, temp) == 0) { cout << endl << BLOCK2[i].name << " " << BLOCK2[i].num << endl; count++; } } if (count == 0) cout << endl << " ΠΠ΅Ρ ΡΠ°ΠΊΠΎΠΉ ΡΠ°ΠΌΠΈΠ»ΠΈΠΈ\n"; } _getch(); } 
strcmp(BLOCK2[i].date, temp)- acade