Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <conio.h>
- using namespace std;
- int main() {
- int x;
- cin >> x;
- for (int i = log(x) / log(10); i >= 0; i--) {
- int weight = x / pow(10, i);
- cout << weight << endl;
- x = x - weight * pow(10, i);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement