Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
118347 梁乃元 十进制转d进制 C++ 通过 100 0 MS 248 KB 368 2023-12-30 08:14:10

Tests(10/10):


# include <iostream> using namespace std ; char i2c ( int x ) { if ( x < 10 ) { return '0' + ( x - 0 ) ; } return 'A' + ( x - 10 ) ; } int main ( ) { int a , b ; cin >> a >> b ; string s ; if ( a == 0 ) { s = "0" ; } while ( a != 0 ) { s = i2c ( a % b ) + s ; a -= a % b ; a /= b ; } cout << s << endl ; return 0 ; }


测评信息: