Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- struct virus
- {
- char nume_tara[100], nume_virus[100];
- int k, nrtpop, nrtcaz, nrtmort, nrtvind, nrcinc;
- double rm, p;
- } tara,v[200];
- void citire(struct virus &tara)
- {
- cin>>tara.nume_tara>>tara.nume_virus>>tara.nrtpop>>tara.nrtcaz>>tara.nrtmort>>tara.nrtvind>>tara.nrcinc;
- }
- int active(struct virus tara)
- {
- int nrcactv=0;
- nrcactv=tara.nrtcaz-tara.nrcinc;
- return nrcactv;
- }
- int procentaj_morti(struct virus tara)
- {
- int p=1;
- p=(100*tara.nrtmort)/tara.nrtcaz;
- return p;
- }
- int rata_mortalitate(struct virus tara)
- {
- double rm=1;
- int aux=tara.nrtpop,k=1;
- while(aux>1)
- {
- aux=aux/10;
- k=k*10;
- }
- rm=(tara.nrtmort/tara.nrtpop)*k;
- return rm;
- }
- void afisare(struct virus tara)
- {
- cout<<tara.nume_tara<<" "<<tara.nume_virus<<" "<<tara.nrtpop<<" " <<tara.nrtcaz<<" "<<tara.nrtmort<<" "<<tara.nrtvind<<" "<<tara.nrcinc;
- }
- void afisare1(int tara)
- {
- cout<<tara;
- }
- int main()
- {
- struct virus;
- citire(tara);
- afisare(tara);
- active(tara);
- afisare1(nrcactv);
- procentaj_morti(tara);
- afisare1(p);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement