Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include <vector>
  2. #include <string>
  3. #include <iostream>
  4. #include <cstdio>
  5.  
  6. struct Person{
  7. std::string nume;
  8. std::string prenume;
  9. std::string cnp;
  10. uint32_t nr_cerere;
  11. void print() {
  12. std::cout<<nume<<" "<<prenume<<" "<<nr_cerere<<std::endl;
  13. }
  14. };
  15.  
  16. std::vector<Person> readData(uint32_t peopleCount) {
  17. std::vector<Person> v;
  18.  
  19. for(uint32_t i=0;i<peopleCount;i++) {
  20. struct Person p;
  21. std::cin >> p.nume >> p.prenume >> p.cnp >> p.nr_cerere;
  22. v.emplace_back(p);
  23. }
  24. }
  25.  
  26. void erasePerson(std::vector<Person> * people) {
  27. people->erase(people->end());
  28. }
  29.  
  30.  
  31. std::vector<Person>::iterator find_max(std::vector<Person> * people) {
  32. int max=0;
  33. for(auto iter = people->begin(); iter != people->end(); ++iter){
  34. if(iter->nr_cerere > max){
  35. iter->nr_cerere = max;
  36. break;
  37. }
  38. }
  39. }
  40.  
  41. int main() {
  42.  
  43.  
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement