Facebook
From Mateusz Rojek, 3 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 96
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  5.  
  6. void funkcja1() {
  7.         char tablica[10];
  8.        
  9.         for (int i = 0; i < 10; i++) {
  10.                 cout << "Podaj znak z klawiatury: ";
  11.                 cin >> tablica[i];
  12.         }
  13.        
  14.         cout << "Zawartosc twojej tablicy: ";
  15.         for (int i = 0; i < 10; i++) {
  16.                 if (i != 9) {
  17.                         cout << tablica[i] << ", ";
  18.                 } else {
  19.                         cout << tablica[i];
  20.                 }
  21.         }
  22. }
  23.  
  24. int main(int argc, char** argv) {
  25.         funkcja1();
  26.         return 0;
  27. }
  28.