Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int liczba, sumaCyfr=0, tmp;
  8.     cin >> liczba;
  9.     while(liczba!=0)
  10.     {
  11.         tmp=liczba%10;
  12.         sumaCyfr=sumaCyfr+tmp;
  13.         liczba=liczba/10;
  14.         cout << "tmp: " << tmp << endl;
  15.         cout << "sumaCyfr: " << sumaCyfr << endl;
  16.         cout << "Liczba: " << liczba << endl;
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement