首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
ZeroQi_404
2026年3月15日 13:53
进制转换 题解:
P1178
回复 0
|
赞 8
|
浏览 179
#include <iostream> #include <string> using namespace std; int main(){ string n; while(cin >> n){ if(n=="0"){ cout << 0 << endl; continue; } string ans=""; while(n!="0"){ int r=0; for(int i=0;i<n.size();i++){ int...
isnotlnln
2026年2月26日 13:30
进制转换 题解:除2取余法
P1178
回复 0
|
赞 22
|
浏览 603
#include <cstdio> #include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; string s; int mod() { return (s[s.size()-1]-'0')%2; } void div() { string res; int carry=0; for(int i=0;i<s.size();i...
mlx
2026年2月4日 23:54
进制转换 题解:
P1178
回复 0
|
赞 10
|
浏览 414
#include<iostream> #include<algorithm> #include<vector> using namespace std; string s; int mod() { return (s[s.size()-1]-'0')%2; } void div() { string res; int t=0; for(int i=0;i<s.size();i++) { int x=s[i]-'0'+t; if(x<2&&i==0) { ...
xsw
2026年2月1日 09:52
进制转换 题解:
P1178
回复 0
|
赞 2
|
浏览 266
#include <iostream> #include <algorithm> #include <vector> using namespace std; vector<int> divide(vector<int> A, int b) { vector<int> C; for (int i = A.size() - 1, r = 0; i >= 0; i --) { r = r * 10 + A[i]; C.push_back(r...
曾不会
2026年1月25日 20:18
进制转换 题解:
P1178
回复 0
|
赞 1
|
浏览 328
使用python工具 while(1): try: n=int(input()) s=bin(n) ss=s[2:] print(ss) except: break
leo110
2025年8月26日 21:33
进制转换 题解:字符串解题:从高位开始往后走,将10倍转换成(2³+2
P1178
回复 0
|
赞 8
|
浏览 977
#include<iostream> #include<cstring> using namespace std; string Biadd(string s1,string s2){ string str; while(s1.length()<s2.length()){ s1.insert(0,"0"); } &nbs...
无名1
2025年6月25日 18:41
进制转换 题解:C++ 可主要分为两步:1.大数对2取余;2.大数除以
P1178
回复 0
|
赞 24
|
浏览 1.1k
#include<bits/stdc++.h> using namespace std; bool isZero(int a[],int len){ for(int i=0;i<len;i++){ if(a[i]!=0){ return false; } } return true; } int main(){ string s; while(cin>>s){ int num[100]={0},a[100]={0},index=0;//a数组中保存余数 int len=s.length...
zxjrheaven
2025年3月12日 21:50
进制转换 题解:已燃尽
P1178
回复 0
|
赞 22
|
浏览 1.6k
#include <iostream> #include <string> #include <algorithm> using namespace std; // 去除前导零,返回处理后的字符串 string remove_leading_zeros(const string &s) { size_t start = 0; while (start < s.size() && s[start] == '0') { ...
carrot_huan
2025年3月10日 00:18
进制转换 题解:自定义字符串除法+用stack存储答案+用除法来控制循
P1178
回复 0
|
赞 6
|
浏览 1.2k
#include<iostream> #include<string> #include<stack> using namespace std; bool Divide(string& str,stack<int>& re) { if (str == "0") { re.push(0);return 0; } if (str == "1") { re.push(1);return 0; } ...
myming
2024年7月20日 14:00
进制转换 题解:
P1178
回复 0
|
赞 53
|
浏览 2.1k
#include<bits/stdc++.h> using namespace std; void decimal_to_binary(char s[]){ char out[105]; int len = strlen(s); int k = 0; while(len){ //用最后一位数字计算余数 &...
1
2
题目
进制转换
题解数量
18
发布题解
在线答疑
热门题解
1
大数的进制转换
2
进制转换 题解:
3
进制转换 题解:模板+二进制+字符串的处理
4
进制转换 题解:c语言:把数组当成二进制数直接进行除法
5
进制转换 题解:C++ 可主要分为两步:1.大数对2取余;2.大数除以2
6
进制转换 题解:已燃尽
7
进制转换 题解:除2取余法
8
进制转换 题解:C
9
大数进制转换
10
C++