poj 百练2734(基础题)

来源:互联网 发布:自动记账软件 编辑:程序博客网 时间:2024/05/21 16:56
#include <fstream>#include <string>#include <cstdio>#include <stack>using namespace std;#define _cdebbug//全局数据int main(){//重定向#ifdef _cdebbugfreopen("F:\\input.txt","r",stdin );#endif    long shu;long temp;int yushu;stack<int> stk;scanf("%d",&shu);while (shu != 0){yushu = shu % 8;stk.push(yushu);shu = shu / 8;}while (!stk.empty()){printf("%d",stk.top());stk.pop();}printf("\n");//解除重定向关闭文件#ifdef _cdebbugfclose(stdin); #endifreturn 0 ;}


能有比这更基础的题目么

虽然基础,复习十进制转换任意进制方法:

除n取余到0,逆序排列