Advertisement
pVinc

rozklad.cpp

Oct 22nd, 2019
141
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.         int x, c=0, tab[10], i=0, k=0, a=0;
  7.         for(k; k <= 9; k++){
  8.                 tab[k] = 0;
  9.         }
  10.  
  11.         cout << "Podaj liczbe" << endl;
  12.         cin >> x;
  13.  
  14.         while(x > 0){
  15.                 a = x%10;
  16.                 tab[c] = a;
  17.                 x /= 10;
  18.                 c++;
  19.         }
  20.  
  21.         for(i; i <= c-1; i++){
  22.                 cout << tab[i] << endl;
  23.         }
  24.         return 0;
  25. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement