The Title Description converts the decimal number to octal and outputs the result. Figure: Convert the decimal number to octal and the output input contains several decimal positive integers. Output the corresponding Octal numbers, each of which occupies one row. Sample input 1237891910020345 sample output 123710112346162771 prompt [+] *** prompt hidden, click [+] at the top to display the *** source data structure algorithm teaching question -- Zhang Feifei [cpp]/******************* * **************** Date: * Author: SJF0115 * question: tianqin OJ question 1020: algorithm 3-1: octal number * Source: http://acmclub.com/problem.php? Id = 1020 * result: AC * Source: Data Structure algorithm teaching question -- Zhang Feifei * Summary: * *********************************/# include <stdio. h >#include <iostream >#include <stack> using namespace std; # define MAXSIZE 1000 // input string char str [MAXSIZE]; // convert the 10th hexadecimal form to B (stack) void Conversion (int num, int B) {stack <int> S; // except B for the remainder do {// the remainder is stored in stack S. push (num % B); num/= B;} while (num); // output while (! S. empty () {printf ("% d", S. top (); S. pop () ;}printf ("\ n") ;}int main () {int a, B; while (scanf ("% d", & )! = EOF) {B = 8; // convert the decimal format to the octal Conversion (a, B);} return 0 ;} /********************************** Date: * Author: SJF0115 * question: tianqin OJ question 1020: algorithm 3-1: octal number * Source: http://acmclub.com/problem.php? Id = 1020 * result: AC * Source: Data Structure algorithm teaching question -- Zhang Feifei * Summary: * *********************************/# include <stdio. h >#include <iostream >#include <stack> using namespace std; # define MAXSIZE 1000 // input string char str [MAXSIZE]; // convert the 10th hexadecimal form to B (stack) void Conversion (int num, int B) {stack <int> S; // except B for the remainder do {// the remainder is stored in stack S. push (num % B); num/= B;} while (num); // output while (! S. empty () {printf ("% d", S. top (); S. pop () ;}printf ("\ n") ;}int main () {int a, B; while (scanf ("% d", & )! = EOF) {B = 8; // convert the decimal format to the octal Conversion (a, B);} return 0 ;}