首页 > 试题广场 >

进制转换2

[编程题]进制转换2
  • 热度指数:15544 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32M,其他语言64M
  • 算法知识视频讲解
将M进制的数X转换为N进制的数输出。

输入描述:
输入的第一行包括两个整数:M和N(2<=M,N<=36)。
下面的一行输入一个数X,X是M进制的数,现在要求你将M进制的数X转换成N进制的数输出。


输出描述:
输出X的N进制表示的数。
示例1

输入

10 2
11

输出

1011

备注:
注意输入时如有字母,则字母为大写,输出时如有字母,则字母为小写。
头像 鱼儿恋上水
发表于 2020-03-24 23:52:15
类似题目:http://poj.org/problem?id=1220高精度进制转换原理:https://www.cnblogs.com/kuangbin/archive/2011/08/09/2132467.html①利用整型数组存储参考博客:https://www.cnblogs.com/bhl 展开全文
头像 牛客35177536号
发表于 2021-02-16 16:37:43
直接从m进制转换成n进制,以防用例有大数所以用字符串处理。编写字符串除法和字符串求余实现。。。 #include <iostream> #include <cstdio> #include <stack> #include < 展开全文
头像 薇薇啵啵
发表于 2020-04-08 21:14:10
#include <iostream> #include <cstdio> #include <vector> using namespace std; int charToInt(char c){ if(c>='0'&&c< 展开全文
头像 帅呆呆~
发表于 2022-03-08 12:10:11
#include<iostream> #include<cstdio> #include<stack> using namespace std; int CharToInt(char c){ if(c >= '0' && c <= 展开全文
头像 Coming680
发表于 2022-01-26 22:47:07
#include<iostream> #include<stack> #include<string> using namespace std; int main() { int m, n; cin >> m >> n; 展开全文
头像 粉詹眉
发表于 2024-03-20 18:54:14
#include <iostream> #include <algorithm> using namespace std; //m进制转换为10进制数 long long ConvertToTen(int m,string x){ long long res=0; 展开全文
头像 WonderFF
发表于 2024-03-17 11:15:04
#include<iostream> #include<string> #include<algorithm> #include<stack> #include<math.h> using namespace std; int main() 展开全文
头像 在抱佛脚的海豚很想吃烤肉
发表于 2023-02-23 20:54:01
#include <stdio.h> #include<math.h> // 计算字符串长度: int Length(char a[]) { int n = 0; for (int i = 0; a[i] != '\0'; i++) { 展开全文
头像 rainman_
发表于 2023-03-16 20:02:22
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <stack> #include <map> using 展开全文
头像 _洋洋_
发表于 2024-03-21 22:04:59
//KY235 进制转换2 //将M进制的数X转换为N进制的数输出。 #include<cstdio> #include<bits/stdc++.h> #include <cmath> using namespace std; int main(){ ch 展开全文

问题信息

上传者:小小
难度:
74条回答 6093浏览

热门推荐

通过挑战的用户

查看代码