Advertisement
Qpel

ciklai 2 užd

Mar 19th, 2017
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8.     int n = 1986, temp = 0, dtemp = 0;
  9.     cout << "Iveskite skaiciu : " ;
  10.     cin >> n;
  11.  
  12.     while (n > 0){
  13.         temp*=10;
  14.         temp+= n % 10;
  15.         temp = temp * 10 + n % 10;
  16.         cout << temp << endl;
  17.         n/=10;
  18.  
  19.     }
  20.  
  21.  
  22.  
  23.     while (temp > 0){
  24.         dtemp*=10;
  25.         dtemp+= temp % 10;
  26.         temp/=10;
  27.  
  28.     }
  29.  
  30.     cout << dtemp;
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement