Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <conio.h>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.  
  9. int x;
  10. cin >> x;
  11.  
  12. for (int i = log(x) / log(10); i >= 0; i--) {
  13. int weight = x / pow(10, i);
  14. cout << weight << endl;
  15. x = x - weight * pow(10, i);
  16. }
  17.  
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement