рд╕рдВрд░рдЪрдирд╛рдУрдВ рдХреЗ рд╕рд╛рде рдХрд╛рдо рдХрд░рдирд╛ рдпрд╛ рдореИрдВрдиреЗ рдкрдардиреАрдп рдХреЛрдб рд▓рд┐рдЦрдирд╛ рдХреИрд╕реЗ рд╕реАрдЦрд╛

рдпрд╣ рд╕рдм рдХреИрд╕реЗ рд╢реБрд░реВ рд╣реБрдЖ


рдореИрдВ рдПрдХ рддрдХрдиреАрдХреА рд╡рд┐рд╢реНрд╡рд╡рд┐рджреНрдпрд╛рд▓рдп рдореЗрдВ рдПрдХ рдЫрд╛рддреНрд░ рд╣реВрдВ рдФрд░ рдЗрд╕ рджрд┐рд╢рд╛ рдореЗрдВ рдЕрдзреНрдпрдпрди рдХрд░ рд░рд╣рд╛ рд╣реВрдВ: "рдЙрдЪреНрдЪ рдЧрдгрд┐рдд, рдХрдВрдкреНрдпреВрдЯрд░ рд╡рд┐рдЬреНрдЮрд╛рди рдФрд░ рдЧрдгрд┐рддреАрдп рдореЙрдбрд▓рд┐рдВрдЧред" рдЪреВрдВрдХрд┐ рдореИрдВ рдХреЗрд╡рд▓ рдЕрдкрдиреЗ рджреВрд╕рд░реЗ рд╡рд░реНрд╖ рдореЗрдВ рд╣реВрдВ, рдЗрд╕рд▓рд┐рдП рдореЗрд░реЗ рдХреЛрдб рдХреЛ рд╕рд╣реА рдХрд╣рдирд╛ рдмрд╣реБрдд рдореБрд╢реНрдХрд┐рд▓ рд╣реИред рдЕрдВрддрд┐рдо рд╕реЗрдореЗрд╕реНрдЯрд░, рд╣рдордиреЗ "рдЖрдзреБрдирд┐рдХ рдкреНрд░реЛрдЧреНрд░рд╛рдорд┐рдВрдЧ рдкреНрд░рддрд┐рдорд╛рди" рдЬреИрд╕реЗ рдЕрдиреБрд╢рд╛рд╕рди рдХрд╛ рдЕрдзреНрдпрдпрди рдХрд┐рдпрд╛ред рд╡реНрдпрд╛рдЦреНрдпрд╛рди рдореЗрдВ рд╕реЗ рдПрдХ рдкрд░, рд╣рдордиреЗ рдПрдХ рдЙрджрд╛рд╣рд░рдг рдХреЗ рд░реВрдк рдореЗрдВ C ++ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ OOP рдХреА рдЬрд╛рдВрдЪ рдХреА рдФрд░ рд╕рдВрд░рдЪрдирд╛рдУрдВ рдХреЗ рд╕рд╛рде рдПрдХ рдЫрджреНрдо-рд╕рдВрдЧреАрдд рдкреБрд╕реНрддрдХрд╛рд▓рдп рд▓рд┐рдЦрдиреЗ рдХрд╛ рдХрд╛рд░реНрдп рдорд┐рд▓рд╛ред

рдХрд╛рд░реНрдп рдФрд░ рдХрд╛рд░реНрдпрдХреНрд░рдо рдХрд╛ рдкрд╣рд▓рд╛ рд╕рдВрд╕реНрдХрд░рдг


рдХрд╛рд░реНрдпрдХреНрд░рдо 5 рдХреНрд╖реЗрддреНрд░реЛрдВ рдХреА рд╕рдВрд░рдЪрдирд╛ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдиреЗ рд╡рд╛рд▓рд╛ рдерд╛:
рдлрд╝реАрд▓реНрдб рдирдВрдмрд░ 1: рд░рд┐рдХреЙрд░реНрдб рд╕рдВрдЦреНрдпрд╛;
рдлрд╝реАрд▓реНрдб рдирдВрдмрд░ 2: рдЯреНрд░реИрдХ рдХрд╛ рдирд╛рдо;
рдлрд╝реАрд▓реНрдб рдирдВрдмрд░ 3: рдХрд▓рд╛рдХрд╛рд░ рдХрд╛ рдирд╛рдо;
рдХреНрд╖реЗрддреНрд░ рд╕рдВрдЦреНрдпрд╛ 4: рд╕рдордп рдЦреЗрд▓рдирд╛;
рдХреНрд╖реЗрддреНрд░ рд╕рдВрдЦреНрдпрд╛ 5: рд░рд┐рдХреЙрд░реНрдбрд┐рдВрдЧ рдХрд╛ рд╡рд░реНрд╖ред
рдпрд╣ рдПрдХ рдХрдВрд╕реЛрд▓ рдкреНрд░реЛрдЧреНрд░рд╛рдо рд╣реЛрдирд╛ рдЪрд╛рд╣рд┐рдП рдерд╛, рдЬрд┐рд╕рдореЗрдВ рд╕рднреА рдбреЗрдЯрд╛ рдХреАрдмреЛрд░реНрдб рд╕реЗ рдпрд╛ рдПрдХ рдЯреЗрдХреНрд╕реНрдЯ рдлрд╝рд╛рдЗрд▓ (рд▓реЗрдЦрдХ рдХреЗ рдЕрдиреБрд░реЛрдз рдкрд░) рд╕реЗ рджрд░реНрдЬ рдХрд┐рдпрд╛ рдЧрдпрд╛ рд╣реИред рджрд░реНрдЬ рдХрд┐рдП рдЧрдП рдбреЗрдЯрд╛ рдХреЛ рдХреНрд░рдорд╢рдГ рдХрдВрдкреНрдпреВрдЯрд░ рдореЗрдореЛрд░реА рдпрд╛ рдПрдХ рдлрд╝рд╛рдЗрд▓ рдореЗрдВ рд╕рдВрдЧреНрд░рд╣реАрдд рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред рд╕рд╛рде рд╣реА, рдкреНрд░реЛрдЧреНрд░рд╛рдо рдХреЛ рдирд┐рдореНрди рдХрдорд╛рдВрдб рдирд┐рд╖реНрдкрд╛рджрд┐рдд рдХрд░рдиреА рдЪрд╛рд╣рд┐рдП:
рдЦреЛрдЬ: рд╕рдВрдЦреНрдпрд╛, рд╢реАрд░реНрд╖рдХ, рдХрд▓рд╛рдХрд╛рд░, рд░рд┐рдХреЙрд░реНрдбрд┐рдВрдЧ рдХрд╛ рд╕рдордп рдФрд░ рд╡рд░реНрд╖ рдХреЗ рд╕рд╛рде-рд╕рд╛рде рд╕реНрдХреНрд░реАрди рдкрд░ рд╕рднреА рд░рд┐рдХреЙрд░реНрдбрд┐рдВрдЧ рдХрд╛ рдкреНрд░рджрд░реНрд╢рди;
рдбреЗрдЯрд╛ рдмрджрд▓реЗрдВ: рд╣рдЯрд╛рдПрдВ, рд╕рдВрдкрд╛рджрд┐рдд рдХрд░реЗрдВ рдФрд░ рдирдП рд░рд┐рдХреЙрд░реНрдб рдЬреЛрдбрд╝реЗрдВ;
рд╕рдВрдкрд╛рджрди: рд░рд┐рдХреЙрд░реНрдб рд╕рдВрдЦреНрдпрд╛ рдХреЛ рдЫреЛрдбрд╝рдХрд░ рд╕рднреА рдХреНрд╖реЗрддреНрд░реЛрдВ рдХреЛ рдмрджрд▓рдиреЗ рдХреА рдХреНрд╖рдорддрд╛ред

рд▓рдЧрднрдЧ рджреЛ рд╕рдкреНрддрд╛рд╣ рдХреЗ рдЖрд▓рд╕реНрдп рдХреЗ рдмрд╛рдж, рдирд┐рдореНрди рдХреЛрдб рд▓рд┐рдЦрд╛ рдЧрдпрд╛ рдерд╛ (рдкреНрд░рджрд░реНрд╢рд┐рдд рдкрд╛рда рдХрд╛ рдЕрдзрд┐рдХрд╛рдВрд╢ рд▓рд┐рдкреНрдпрдВрддрд░рдг рдореЗрдВ рд▓рд┐рдЦрд╛ рдЧрдпрд╛ рдерд╛, рдХреНрдпреЛрдВрдХрд┐ рд╕реНрдХреВрд▓ рдореЗрдВ рдореИрдВрдиреЗ рдЬрд░реНрдорди рдХрд╛ рдЕрдзреНрдпрдпрди рдХрд┐рдпрд╛ рдерд╛, рдЕрдВрдЧреНрд░реЗрдЬреА рдХрд╛ рдирд╣реАрдВ):

рдХреНрдпрд╛ рдЖрдкрдХреЛ рднрдпрднреАрдд рдХрд░ рд╕рдХрддрд╛ рд╣реИ!
#include <cstdlib> #include <iostream> #include <string> struct Muslib{ int num; std::string name; std::string artist; std::string time; short jear;}; using namespace std; int main(int argc, char *argv[]) { Muslib muslib[100]; int kil; cout<<"Vvedit' kil'kist pisen' yaku bazhaete dodaty u bazu dannyh: "; cin>>kil; for(int i=1; i<=kil; i++){ muslib[i].num=i; cout<<"Input name: "; cin>>muslib[i].name; cout<<"Input artist: "; cin>>muslib[i].artist; cout<<"Enter time: "; cin>>muslib[i].time; cout<<"Enter jear: "; cin>>muslib[i].jear; cout<<endl;} string command; int n=-1; string str[15]; while(command!="exit"){ cout<<"Enter command (num, name, artist, time, jear, del, add, all, re). Dlya vyhoda vvedite 'exit'!"<<endl; cin>>command; if(command=="num"){ cout<<"Enter num: "; cin>>n; cout<<"Number "<<muslib[n].num<<endl; cout<<"Name "<<muslib[n].name<<endl; cout<<"Artist "<<muslib[n].artist<<endl; cout<<"Time "<<muslib[n].time<<endl; cout<<"Jear "<<muslib[n].jear<<endl; } if(command=="name"){ cout<<"Enter name: "; cin>>str[15]; for(int i=0; i<kil; i++){ if(str[15]==muslib[i].name){ n=i; cout<<"Number "<<muslib[n].num<<endl; cout<<"Name "<<muslib[n].name<<endl; cout<<"Artist "<<muslib[n].artist<<endl; cout<<"Time "<<muslib[n].time<<endl; cout<<"Jear "<<muslib[n].jear<<endl; } if(i==kil-1&&n==-1) cout<<"Element not found!"<<endl; } } if(command=="artist"){ cout<<"Enter artist: "; cin>>str[10]; for(int i=0; i<kil; i++){ if(str[10]==muslib[i].artist){ n=i; cout<<"Number "<<muslib[n].num<<endl; cout<<"Name "<<muslib[n].name<<endl; cout<<"Artist "<<muslib[n].artist<<endl; cout<<"Time "<<muslib[n].time<<endl; cout<<"Jear "<<muslib[n].jear<<endl; } if(i==kil-1&&n==-1) cout<<"Element not found!"<<endl; } } if(command=="time"){ cout<<"Enter time: "; cin>>str[10]; for(int i=0; i<kil; i++){ if(str[10]==muslib[i].time){ n=i; cout<<"Number "<<muslib[n].num<<endl; cout<<"Name "<<muslib[n].name<<endl; cout<<"Artist "<<muslib[n].artist<<endl; cout<<"Time "<<muslib[n].time<<endl; cout<<"Jear "<<muslib[n].jear<<endl; } if(i==kil-1&&n==-1) cout<<"Element not found!"<<endl; } } int jahr; if(command=="jear"){ cout<<"Enter jear: "; cin>>jahr; for(int i=0; i<kil; i++){ if(jahr==muslib[i].jear){ n=i; cout<<"Number "<<muslib[n].num<<endl; cout<<"Name "<<muslib[n].name<<endl; cout<<"Artist "<<muslib[n].artist<<endl; cout<<"Time "<<muslib[n].time<<endl; cout<<"Jear "<<muslib[n].jear<<endl; } if((i==kil-1)&&(n==-1)) cout<<"Element not found!"<<endl; } } if(command=="add"){//new elem int kill; cout<<"Vvedit' kilkist' novyh elementiv: "; cin>>kill; for(int i=kil+1; i<=kil+kill; i++){ muslib[i].num=i; cout<<"Input name: "; cin>>muslib[i].name; cout<<"Input artist: "; cin>>muslib[i].artist; cout<<"Enter time: "; cin>>muslib[i].time; cout<<"Enter jear: "; cin>>muslib[i].jear;} kil=kil+kill;//kilkist elem } if(command=="all"){ for(int i=1; i<=kil; i++){ cout<<"Number "<<muslib[i].num<<endl; cout<<"Name "<<muslib[i].name<<endl; cout<<"Artist "<<muslib[i].artist<<endl; cout<<"Time "<<muslib[i].time<<endl; cout<<"Jear "<<muslib[i].jear<<endl; cout<<endl; } } if(command=="re"){//perepysat pole cout<<"Enter num: "; cin>>n; cout<<"Number "<<muslib[n].num<<endl; cout<<"Name "<<muslib[n].name<<endl; cout<<"Artist "<<muslib[n].artist<<endl; cout<<"Time "<<muslib[n].time<<endl; cout<<"Jear "<<muslib[n].jear<<endl; cout<<endl; string pole; cout<<"Vvedit' imya polya: "; cin>>pole; if(pole=="name") cin>>muslib[n].name; if(pole=="artist") cin>>muslib[n].artist; if(pole=="time") cin>>muslib[n].time; if(pole=="jear") cin>>muslib[n].jear; if(pole!="name"&pole!="artist"&pole!="time"&pole!="jear") cout<<"Pole not found :("<<endl; } if(command=="del"){ cout<<"Enter num: "; cin>>n; muslib[n].num=0; for(int i=1; i<=kil; i++){ if(muslib[i].num!=i){ muslib[i].num=i; muslib[i].name=muslib[i+1].name; muslib[i].artist=muslib[i+1].artist; muslib[i].time=muslib[i+1].time; muslib[i].jear=muslib[i+1].jear; muslib[i+1].num=0; } } kil=kil-1; } } system("PAUSE"); return EXIT_SUCCESS; } 

рд╕рдм рдХреБрдЫ рд╣реЛрдиреЗ рдХреЗ рдмрд╛рд╡рдЬреВрдж, рдореЗрд░реЗ рдЗрд╕ рдЧреЛрд╡рдиреЛрдХреЙрдб рдиреЗ рд╣рдорд╛рд░реЗ рд╕рдореВрд╣ рдХреЗ рдЕрдзрд┐рдХрд╛рдВрд╢ рдЫрд╛рддреНрд░реЛрдВ рдХреЗ рд░реВрдк рдореЗрдВ рдЙрд╕реЗ рдкрд╛рд╕ рдХрд░рдиреЗ рдХреА рдХреЛрд╢рд┐рд╢ рдХреАред рдЗрд╕рдХрд╛ рдкрд░рд┐рдгрд╛рдо 10 рд╕реЗ рдЕрдзрд┐рдХ рдХреАрдбрд╝реЛрдВ рдХреА рдЦреЛрдЬ рдФрд░ рдЙрдирдХреА рдЕрдиреБрдорд╛рдирд┐рдд рдЧрд▓рддрдлрд╣рдореА рдереА рдХрд┐ рд╡реЗ рдХрд┐рд╕ рдЪреАрдЬ рдХреЗ рд▓рд┐рдП рдЕрдиреБрдорд╛рди рд▓рдЧрд╛рдиреЗ рдХреА рдХреЛрд╢рд┐рд╢ рдХрд░ рд░рд╣реЗ рдереЗред рд▓реЗрдХрд┐рди рдЙрдирдХрд╛ рдореБрдЦреНрдп рдХрд╛рд░реНрдп рдПрдХ рдореВрд▓реНрдпрд╛рдВрдХрди рдкреНрд░рд╛рдкреНрдд рдХрд░рдирд╛ рд╣реИ, рдЗрд╕ рдХрд╛рд░реНрдпрдХреНрд░рдо рдиреЗ рдкреВрд░реА рддрд░рд╣ рд╕реЗ рдкреНрд░рджрд░реНрд╢рди рдХрд┐рдпрд╛ред

рдкреВрд░реНрдг рдЙрдиреНрдирдпрди рдФрд░ рд╕рдВрд╕реНрдХрд░рдг 2.0


рдЗрд╕ рдХрд╛рд░реНрдпрдХреНрд░рдо рдХреЛ рдкрд╛рд░рд┐рдд рдХрд░рдиреЗ рдХреЗ 2 рдорд╣реАрдиреЗ рд╕реЗ рдЕрдзрд┐рдХ рд╕рдордп рд╣реЛ рдЧрдпрд╛ рд╣реИ рдФрд░ рдЗрд╕ рд╡рд┐рд╖рдп рдореЗрдВ рдкрд░реАрдХреНрд╖рд╛ рдкрд╛рд╕ рдХрд░рдиреЗ рдХреЗ рдПрдХ рдорд╣реАрдиреЗ рдмрд╛рджред рдШрд░ рдкрд░ рдЫреБрдЯреНрдЯреА рдкрд░ рдмреИрдареЗ рдФрд░ рд╣реЙрд╕реНрдЯрд▓ рдореЗрдВ рддреЗрдЬ рдЗрдВрдЯрд░рдиреЗрдЯ рд╕реЗ рдКрдм рдХрд░, рдЗрд╕ рдХрд╛рд░реНрдпрдХреНрд░рдо рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ рдЗрд╕ рдХрд╛рд░реНрдпрдХреНрд░рдо рдХреЛ рдлрд┐рд░ рд╕реЗ рд▓рд┐рдЦрдиреЗ рдХреЗ рд▓рд┐рдП рдПрдХ рд╢рд╛рдирджрд╛рд░ рд╡рд┐рдЪрд╛рд░ рдХрд╛ рдЬрдиреНрдо рд╣реБрдЖред рдпрд╣ рдореЗрд░реА рджреБрдЦрддреА рд░рдЧ рдереАред рдбреЗрдврд╝ рд╕рд╛рд▓ рддрдХ, рдореИрдВрдиреЗ рдХрднреА рдирд╣реАрдВ рд╕реАрдЦрд╛ рдХрд┐ рдЙрдирдХрд╛ рдЙрдкрдпреЛрдЧ рдХреИрд╕реЗ рдХрд┐рдпрд╛ рдЬрд╛рдПред 3 рдЬреА рдореЙрдбреЗрдо рдФрд░ рдЕрдирдиреНрдд Google рдХреЗ рд╕рд╛рде рд╕рд╢рд╕реНрддреНрд░, рд╡рд╣ C ++ рдореЗрдВ рдлрд╝рдВрдХреНрд╢рдВрд╕ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдиреЗ рдХреЗ рдЙрджрд╛рд╣рд░рдгреЛрдВ рдХреА рддрд▓рд╛рд╢ рдХрд░рдиреЗ рд▓рдЧрд╛ред рд╕рдорд╛рдирд╛рдВрддрд░ рдореЗрдВ рджреЗрд╡-рд╕реА ++ рдореЗрдВ рдЗрдВрдЯрд░рдиреЗрдЯ рд╕рд░реНрдлрд┐рдВрдЧ рдФрд░ рдХреЛрдб рд▓рд┐рдЦрдиреЗ рдХреЗ 3 рдШрдВрдЯреЗ рдмрд╛рдж, рдореИрдВ рдпрд╣ рд╕рдордЭрдиреЗ рдореЗрдВ рд╕рдХреНрд╖рдо рдерд╛ рдХрд┐ рдпрд╣ рдХреИрд╕реЗ рдХрд╛рдо рдХрд░рддрд╛ рд╣реИред рдПрдХ рдФрд░ 7 рдШрдВрдЯреЗ рдмреАрдд рдЧрдП рдФрд░ рдХрд╛рд░реНрдпрдХреНрд░рдо рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рддреЗ рд╣реБрдП рдХрд╛рд░реНрдпреЛрдВ рдХреЛ рд▓рдЧрднрдЧ рдкреВрд░реА рддрд░рд╣ рд╕реЗ рдлрд┐рд░ рд╕реЗ рд▓рд┐рдЦрд╛ рдЧрдпрд╛ред рдЕрдм рдЗрд╕реЗ 3 рдлрд╝рд╛рдЗрд▓реЛрдВ рдореЗрдВ рд╡рд┐рднрд╛рдЬрд┐рдд рдХрд┐рдпрд╛ рдЧрдпрд╛ рдерд╛ рдФрд░ рдЗрд╕рдореЗрдВ рдХреЛрдб 100 рд░реЗрдЦрд╛рдПрдБ рдЕрдзрд┐рдХ рдереАрдВ:

muslibrary.h
 #ifndef MUSLIBRARY_H #define MUSLIBRARY_H #include <cstdlib> #include <iostream> #include <string> using namespace std; struct MusLib{ int num; std::string name; std::string artist; std::string time; short jear;}; void AddPositionf(int,int); void helpf(void); void helpref(void); void numf(int,int); void namef(std::string,int); void artistf(std::string,int); void timef(std::string,int); void jearf(short,int); void ref(int,int); void allf(int); int delf(int,int); #endif /* MUSLIBRARY_H */ 

MusikLibrary.cpp
 #include "muslibrary.h" int position; int main(int argc, char *argv[]) { cout<<"Enter the number of positions: "; cin>>position; AddPositionf(0,position); //   string cmd; while(cmd!="exit"){ cout<<"Enter command (Enter 'help' to help): "; cin>>cmd; if(cmd=="help") helpf(); //  else if(cmd=="help_re") helpref(); //    else if(cmd=="num") { //   int number; cin>>number; numf(number,position); } else if(cmd=="name"){ //   std::string name; cin>>name; namef(name,position); } else if(cmd=="artist"){ //   std::string artist; cin>>artist; artistf(artist,position); } else if(cmd=="time"){ //   std::string time; cin>>time; timef(time,position); } else if(cmd=="jear"){ //   short jear; cin>>jear; jearf(jear,position); } else if(cmd=="re"){ // int re; cin>>re; ref(re,position); } else if(cmd=="add"){ // int add; cin>>add; AddPositionf(position,position+add); position=position+add; } else if(cmd=="all") //  allf(position); else if(cmd=="del"){ //  int del; cin>>del; if(del>0&&del<position) { delf(del,position); position=position-1; } } else cout<<"Command not found!"<<endl; //   } //system("PAUSE"); return EXIT_SUCCESS; } 

MusFunc.cpp
 #include "muslibrary.h" MusLib muslib[100]; void AddPositionf(int epos,int pos){ if(epos>=0&&epos<pos){ for(int i=epos; i<pos; i++){ muslib[i].num=i+1; cout<<"Enter name: "; cin>>muslib[i].name; cout<<"Enter artist: "; cin>>muslib[i].artist; cout<<"Enter time: "; cin>>muslib[i].time; cout<<"Enter jear: "; cin>>muslib[i].jear; cout<<endl; } } } void helpf(void){ cout<<"__________________________________"<<endl; cout<<"| command | action |"<<endl; cout<<"|--------------------------------|"<<endl; cout<<"| Find |"<<endl; cout<<"|--------------------------------|"<<endl; cout<<"|num <number> |find position |"<<endl; cout<<"|name <name> |find name |"<<endl; cout<<"|artist <artist> |find artist |"<<endl; cout<<"|time <hh:mm:ss> |find time |"<<endl; cout<<"|jear (jear<9999)|find jear |"<<endl; cout<<"|--------------------------------|"<<endl; cout<<"| Operation of library |"<<endl; cout<<"|--------------------------------|"<<endl; cout<<"|re <num> |rename num |"<<endl; cout<<"|del <num> |delete num |"<<endl; cout<<"|all |print all |"<<endl; cout<<"|add <number> |add position |"<<endl; cout<<"|--------------------------------|"<<endl; cout<<"|exit |Exit |"<<endl; cout<<"|________________________________|"<<endl; } void helpref(void){ cout<<"__________________________________"<<endl; cout<<"| Help Rename |"<<endl; cout<<"|--------------------------------|"<<endl; cout<<"|Not rename for \"Name\"-enter NaN |"<<endl; cout<<"| ------ for \"Artist\"-enter NaN |"<<endl; cout<<"| ------ for \"Time\"-enter NaN |"<<endl; cout<<"| ------ for \"Jear\"-enter 0000 |"<<endl; cout<<"|________________________________|"<<endl; } void numf(int n, int pos){ if(pos>n-1&&n!=0){ cout<<"Position "<<muslib[n-1].num<<endl; cout<<"Name "<<muslib[n-1].name<<endl; cout<<"Artist "<<muslib[n-1].artist<<endl; cout<<"Time "<<muslib[n-1].time<<endl; cout<<"Jear "<<muslib[n-1].jear<<endl; cout<<endl;} else cout<<"Item position "<<n<<" is missing!\n"<<endl; } void namef(std::string str,int pos){ int notfound=0; for(int i=0; i<pos; i++){ if(str==muslib[i].name){ cout<<"Position "<<muslib[i].num<<endl; cout<<"Name "<<muslib[i].name<<endl; cout<<"Artist "<<muslib[i].artist<<endl; cout<<"Time "<<muslib[i].time<<endl; cout<<"Jear "<<muslib[i].jear<<"\n"<<endl; notfound=notfound+1; } } if(notfound==0) cout<<"Elements named \""<<str<<"\" not found!\n"<<endl; } void artistf(std::string str,int pos){ int notfound=0; for(int i=0; i<pos; i++){ if(str==muslib[i].artist){ cout<<"Position "<<muslib[i].num<<endl; cout<<"Name "<<muslib[i].name<<endl; cout<<"Artist "<<muslib[i].artist<<endl; cout<<"Time "<<muslib[i].time<<endl; cout<<"Jear "<<muslib[i].jear<<"\n"<<endl; notfound=notfound+1; } } if(notfound==0) cout<<"Artist \""<<str<<"\" not found!\n"<<endl; } void timef(std::string str,int pos){ int notfound=0; for(int i=0; i<pos; i++){ if(str==muslib[i].time){ cout<<"Position "<<muslib[i].num<<endl; cout<<"Name "<<muslib[i].name<<endl; cout<<"Artist "<<muslib[i].artist<<endl; cout<<"Time "<<muslib[i].time<<endl; cout<<"Jear "<<muslib[i].jear<<"\n"<<endl; notfound=notfound+1; } } if(notfound==0) cout<<"Elements for time \""<<str<<"\" not found!\n"<<endl; } void jearf(short jear, int pos){ int notfound=0; for(int i=0; i<pos; i++){ if(jear==muslib[i].jear){ cout<<"Position "<<muslib[i].num<<endl; cout<<"Name "<<muslib[i].name<<endl; cout<<"Artist "<<muslib[i].artist<<endl; cout<<"Time "<<muslib[i].time<<endl; cout<<"Jear "<<muslib[i].jear<<"\n"<<endl; notfound=notfound+1; } } if(notfound==0) cout<<"Elements for jear \""<<jear<<"\" not found!\n"<<endl; } void ref(int num,int pos){ if(num>0&&num<=pos){ std::string str; short jear; cout<<"Rename help - enter command \"help_re\"!"<<endl; cout<<"Position "<<muslib[num-1].num<<endl; cout<<"Enter new Name: "; cin>>str; if(str!="NaN") muslib[num-1].name=str; cout<<"Enter new Artist: "; cin>>str; if(str!="NaN") muslib[num-1].artist=str; cout<<"Enter new Time: "; cin>>str; if(str!="NaN") muslib[num-1].time=str; cout<<"Enter new Jear: "; cin>>jear; if(jear!=0000) muslib[num-1].jear=jear; } else cout<<"Position not found!\n"<<endl; } void allf(int pos){ for(int i=0; i<pos; i++){ cout<<"Position "<<muslib[i].num<<endl; cout<<"Name "<<muslib[i].name<<endl; cout<<"Artist "<<muslib[i].artist<<endl; cout<<"Time "<<muslib[i].time<<endl; cout<<"Jear "<<muslib[i].jear<<"\n"<<endl; } } int delf(int num,int pos){ muslib[num-1].num=0; for(int i=0; i<pos; i++){ if(muslib[i].num!=i+1){ muslib[i].num=i+1; muslib[i].name=muslib[i+1].name; muslib[i].artist=muslib[i+1].artist; muslib[i].time=muslib[i+1].time; muslib[i].jear=muslib[i+1].jear; muslib[i+1].num=0; } } } 


рджреВрд╕рд░рд╛ рд╡рд┐рдХрд▓реНрдк рднреА рд╕рд╣реА рдирд╣реАрдВ рд╣реИ, рд▓реЗрдХрд┐рди рдкрд╣рд▓реЗ рдХреА рддреБрд▓рдирд╛ рдореЗрдВ рдпрд╣ рдмрд╣реБрдд рдмреЗрд╣рддрд░ рд╣реЛрдЧрд╛ред рдЗрд╕рдХреЗ рдЕрд▓рд╛рд╡рд╛, рдпрд╣рд╛рдВ рдореИрдВрдиреЗ рдЦреБрдж рдХреЛ рдПрдХ рдЕрдиреБрд╡рд╛рджрдХ рдХреЗ рд╕рд╛рде рд╕рд╢рд╕реНрддреНрд░ рдХрд┐рдпрд╛ рдФрд░ рдЬрд┐рддрдирд╛ рд╕рдВрднрд╡ рд╣реЛ рдЙрддрдирд╛ рд╕реБрдВрджрд░ рд▓рд┐рдЦрдиреЗ рдХреА рдХреЛрд╢рд┐рд╢ рдХреАред рдореИрдВ рд╕рднреА рдЖрд▓реЛрдЪрдирд╛ рдФрд░ рд╕рдордЭрдиреЗ рдХреЗ рд╕рд╛рде рд╕рд░рд▓реАрдХрд░рдг рдпрд╛ рд╕реБрдзрд╛рд░ рдХреА рд╕рдВрднрд╛рд╡рдирд╛ рдХреЛ рд╕реНрд╡реАрдХрд╛рд░ рдХрд░реВрдВрдЧрд╛ред

Source: https://habr.com/ru/post/In168075/


All Articles