Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. void wyswietlStudentowPoPodziale3(student *tab, int n){
  2. int licz = 0;
  3. cout << "Studenci, ktorzy otrzymali liczbe punktow podzielna przez 3: " << endl;
  4. for(int i = 0; i < n; i++){
  5. if(tab[i].punkty%3 == 0){
  6. licz++;
  7. cout << tab[i].imie << " " << tab[i].nazwisko << " " << tab[i].punkty << endl;
  8. } else break;
  9. }
  10. cout << endl << "Studenci, ktorzy otrzymali liczbe punktow podzielna przez 3 z reszta 1: " << endl;
  11. for(int i = licz; i < n; i++){
  12. if(tab[i].punkty%3 == 1){
  13. licz++;
  14. cout << tab[i].imie << " " << tab[i].nazwisko << " " << tab[i].punkty << endl;
  15. } else break;
  16. }
  17. cout << endl << "Studenci, ktorzy otrzymali liczbe punktow podzielna przez 3 z reszta 2: " << endl;
  18. for(int i = licz; i < n; i++){
  19. cout << tab[i].imie << " " << tab[i].nazwisko << " " << tab[i].punkty << endl;
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement