Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <fstream>
- const char input[] = "input.txt";
- const char output[] = "o.txt";
- using namespace std;
- void funk(int n);
- int main()
- {
- int n;
- ifstream fd(input);
- fd >> n;
- fd.close();
- funk(n);
- return 0;
- }
- ofstream fr(output);
- void funk(int n)
- {
- int numb = 0;
- if (n > 0) {
- if (n >= 10) {
- fr << n % 10 << endl;
- numb = n / 10;
- funk(numb);
- }
- else {
- fr << n << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement