Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #define size 20
  4. using namespace std;
  5.  
  6. void wypisz(char** t, int ilosc) {
  7. for (int j = 0; j < ilosc; j++) {
  8.  
  9. for (int i = 0; t[j][i] != NULL; i++) {
  10. if (i % 2 == 0) cout << t[j][i]<<", ";
  11. }
  12. cout << endl;
  13. }
  14.  
  15. }
  16. void tworz(char** t,int ile) {
  17. for (int k = 0; k < ile; k++){
  18. t[k] = new char[size];
  19. }
  20. }
  21. void wprowadz(char** t,int ile) {
  22. for (int j = 0; j < ile; j++){
  23. cin >> t[j];
  24.  
  25. }
  26. }
  27. int main()
  28. {
  29. char **t;
  30. t = new char*[size];
  31.  
  32.  
  33. int ile;
  34. cin >> ile;
  35.  
  36. tworz(t, ile);
  37.  
  38. wprowadz(t, ile);
  39.  
  40. wypisz(t,ile);
  41.  
  42. delete[]t;
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement