Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #define ROZMIAR 10
- int main () {
- int i, liczba_el;
- int tablica_el[ROZMIAR];
- // Czytamy elementy petla while
- i = 0;
- cout << "Podaj el. nr 1: ";
- cin >> tablica_el[i];
- i++;
- while ( i < ROZMIAR && tablica_el[i-1]!= 0 ) {
- cout << "Podaj el. nr " << i+1 << " : ";
- cin >> tablica_el[i];
- i++;
- }
- if ( tablica_el[i-1] == 0 ) liczba_el = i - 1;
- else liczba_el = i;
- cout << "Przeczytano : " << liczba_el << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement