Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
118345 梁乃元 十进制转d进制 C++ 解答错误 70 0 MS 244 KB 315 2023-12-30 08:13:04

Tests(7/10):


# include <iostream> using namespace std ; char i2c ( int x ) { return '0' + ( x - 0 ) ; } 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 ; }


测评信息: