Advertisement
IlincaMuresan

Untitled

Apr 2nd, 2020
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4. struct virus
  5. {
  6. char nume_tara[100], nume_virus[100],simptome_virus[256],simptome_pacient[256];
  7. int k, nrtpop, nrtcaz, nrtmort, nrtvind, nrcinc;
  8. double rm, p;
  9. } tara,tara1,tara2,v[200];
  10.  
  11. void citire(struct virus &tara)
  12. {
  13. cin>>tara.nume_tara>>tara.nume_virus>>tara.nrtpop>>tara.nrtcaz>>tara.nrtmort>>tara.nrtvind>>tara.nrcinc;
  14.  
  15. }
  16.  
  17. virus maxim(struct virus tara1,struct virus tara2)
  18. {
  19.  
  20.  
  21.  
  22.  
  23. if(tara1.nrtcaz>tara2.nrtcaz)
  24. {
  25. return tara1.nume_tara;
  26. }
  27. else
  28. {
  29. return tara2.nume_tara;
  30. }
  31. }
  32.  
  33.  
  34. void afisare(struct virus tara)
  35. {
  36. cout<<tara.nume_tara<<" "<<tara.nume_virus<<" "<<tara.nrtpop<<" " <<tara.nrtcaz<<" "<<tara.nrtmort<<" "<<tara.nrtvind<<" "<<tara.nrcinc<<endl;
  37.  
  38.  
  39. int main()
  40. {
  41. int n,i;
  42. virus maxim_,aux;
  43. cin>>n;
  44.  
  45. maxim_={0};
  46. for(i=1;i<=n;i++)
  47. {
  48.  
  49.  
  50. citire(tara);
  51. v[i]=tara;
  52. afisare(v[i]);
  53. }
  54. cout<<endl;
  55.  
  56. for(i=1;i<n;i++)
  57. {
  58. maxim_=maxim(maxim_,v[i]);
  59. }
  60. afisare(maxim_);
  61. cout<<endl;
  62. return 0;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement