Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct Persoana
- {
- char nume[20] = "";
- int varsta;
- int inaltime;
- int nota;
- bool gen;
- } persoane[5];
- int main()
- {
- persoane[0].varsta=12;
- persoane[1].varsta=14;
- persoane[2].varsta=17;
- persoane[3].varsta=20;
- persoane[4].varsta=3;
- int minim = 100; // 12 -> 3
- int maxim = 0;
- for(int i=0; i<5 ; i++)
- {
- if(persoane[i].varsta<minim)
- minim = persoane[i].varsta;
- if(persoane[i].varsta > maxim)
- maxim = persoane[i].varsta;
- }
- cout << "Minim: " << minim << endl;
- cout << "Maxim: " << maxim;
- return 0;
- }
Add Comment
Please, Sign In to add comment