Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #include <string>
  4. #define N 30
  5.  
  6. struct student{
  7. string ime;
  8. string familia;
  9. string fn;
  10. float uspeh;
  11. }*pqr[N];
  12.  
  13. void add_record(student[],int *);
  14. void second_record(student *[],int);
  15. void point_record(student *[],int);
  16. int search_name_max(student *[],int);
  17.  
  18. void main(){
  19. student qz[N];
  20. int choice, num=0;
  21. do{
  22. cout<<"menu"<<endl;
  23. cout<<"1 nov zapis"<<endl;
  24. cout<<"2 tursene"<<endl;
  25. cout<<"3 izvejdane na danni na nai ymniq s nai golqm yspeh kappa"<<endl;
  26. cout<<"4 all"<<endl;
  27. cout<<"5 krai"<<endl;
  28. cout<<"izberi"<<endl;
  29. cin>>choice;
  30. switch (choice){
  31. case 1: add_record(qz,&num); break;
  32. case 2: search_record(pqr,num); break;
  33. case 3: add_record(qz,&num); break;
  34. case 4: add_record(qz,&num); break;
  35.  
  36.  
  37.  
  38. system ("pause");
  39. }
  40.  
  41. void add_record(student qz[], int *num){
  42. int br;
  43. cout<<"br="<<endl;cin>>br;
  44. for (int j=*num;j<*num+br;j++){
  45. cout<<"vuvedete danni za student № "<<j+1<<endl;
  46. cout<<"vuvedi ime"<<endl;
  47. cin.ignore();
  48. getline(cin,qz[j].ime);
  49. cout<<"vuvedi familiq"<<endl;
  50. getline(cin,qz[j].familia);
  51. cout<<"vuvedi fn"<<endl;
  52. cin>>qz[j].fn;
  53. cout<<"yspeh"<<endl;
  54. cin>>qz[j].uspeh;
  55. pqr[j]=&qz[j];
  56. } *num+=br;}
  57.  
  58. void print_record(student *pqr[],int i){
  59. cout<<"/n ime"<<pqr[i]->ime<<endl;
  60. cout<<"/n familiq"<<pqr[i]->familia<<endl;
  61. cout<<"/n fn"<<pqr[i]->fn<<endl;
  62. cout<<"/n uspeh"<<pqr[i]->uspeh<<endl;
  63. }
  64.  
  65. void search_record(student *pqr[], int num){
  66. bool flah=false;
  67. long int tfn;
  68. cout<<"nomer"<<endl;
  69. cin>>tfn;
  70. for(int i=0;i<num;i++){
  71.  
  72. if(tfn==pqr[i]->fn){
  73.  
  74. }
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement