Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. struct struktura
  4. {
  5. int liczba;
  6. char slowo[10];
  7. };
  8. struktura tab[5];
  9. void wczytywanie (struct struktura*liczba, struct struktura*slowo)
  10. {
  11. cout << "Podaj liczbe i slowo: " << endl;
  12. for (int i = 0; i < 5; i++)
  13. {
  14. cout << "Liczba: "; cin>>tab[i].liczba;
  15. cout << "Slowo: "; cin >> tab[i].slowo;
  16. }
  17.  
  18. }
  19. void wyswietlanie(struct struktura*liczba, struct struktura*slowo)
  20. {
  21. for (int i = 0; i < 5; i++)
  22. {
  23. cout << tab[i].liczba << endl;
  24. cout << tab[i].slowo << endl;
  25. }
  26. }
  27. int main ()
  28. {
  29. wczytywanie();
  30. wyswietlanie();
  31. system("pause");
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement