#include using namespace std; int main( int argc, char *argv[] ) { int N; int iVal; int iPos; char S[ 100 ]; // 入力 cin >> N; if( N <= 0 ) { // 出力 cout << 0 << endl; return 0; } // 初期化 iPos = 20; S[ iPos ] = '\0'; // 変換 iVal = N; while( iVal > 0 ) { iPos--; S[ iPos ] = ( iVal % 7 ) + '0'; iVal /= 7; } // 出力 cout << S + iPos << endl; return 0; }