首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
Liinsy
2024年2月28日 21:32
八进制 题解:
P1417
回复 2
|
赞 0
|
浏览 1.1k
为什么vs可以通过家人们? #include<stdio.h> int main() { int n; int a[100]; while(scanf_s("%d",&n)){ int i = 0; while(n > 0) { ...
光明守护神
2024年3月14日 21:27
把2进制那题的2改成8就搞定了!
P1417
回复 0
|
赞 1
|
浏览 1.8k
#include <iostream> #include <vector> using namespace std; int main() { auto n = 1000000; while (cin >> n) { vector<int> r(0); while (n) { r.push_back(n % 8); n /= 8; } for (auto i = r.rbegin(); i != r.rend(); i++) { cout <<...
小酒
2024年3月11日 15:36
八进制 题解:
P1417
回复 0
|
赞 0
|
浏览 973
1417解题思路 #include <iostream> using namespace std; int main() { int a[105]={0}; int n;//输入的十进制 while(cin>>n) { int y; &nbs...
Cookie‘s AE86
2024年1月18日 09:22
八进制 题解:printf语句实现
P1417
回复 0
|
赞 0
|
浏览 1.2k
#include<bits/stdc++.h> using namespace std; int main( ){ int s; while(cin >> s){ printf("%o\n",s); } }
Cookie‘s AE86
2024年1月17日 10:55
八进制 题解:C++实现
P1417
回复 0
|
赞 1
|
浏览 1.5k
#include<bits/stdc++.h> using namespace std; int main( ){ int s; while(cin >> s){ char ans[999999]; int cnt = 0; while(s != 0){ ans[cnt ++] = (s % 8) + '0'; s /= 8; } for(int i = cnt -1 ;i >= 0 ;...
928上岸梦校!
2023年8月5日 10:51
常规进制转换
P1417
回复 0
|
赞 1
|
浏览 1.3k
使用STL容器vector存储八进制串 #include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n) { vector<int> newbase; while (n != 0) { int remainder = n % 8; newbase.push_back(remainder); ...
我不是深井冰丶
2023年3月26日 12:09
一套十进制转n进制的模板
P1417
回复 0
|
赞 0
|
浏览 2.8k
#include <bits/stdc++.h> using namespace std; vector<string> radixArr = {"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"}; // 进制转换 string radixConvert(int x,int d){ string str = ""; while(x!=0){ if(x%d >= 16){ return "null"; ...
Hegel
2023年3月21日 19:48
十进制转八进制
P1417
回复 0
|
赞 1
|
浏览 3.2k
#include <iostream> #include <string> using namespace std; int main() { int n; while(cin>>n){ string res=""; while(n>0){ res=char(n%8+'0')+res; n/=8; } cout<<res<<endl; } return 0; } 思路很简单,重要的是可以熟练写出并应用。
落翼
2023年1月21日 15:22
python求解
P1417
回复 0
|
赞 0
|
浏览 4.2k
使用oct函数可轻松求解: while True: try: a = int(input()) a = oct(a) print(a[2:]) except: break
Sacan
2022年6月2日 21:02
“除x取余,逆序排列”
P1417
回复 0
|
赞 3
|
浏览 4.7k
10进制转x进制,根据数学课上学过的“除x取余,逆序排列”,模拟这个过程就可以。 这里是8进制,x就为8; 当然,当x大于10后,就需要做一些char的变换,如余数10变成a或A。。。 #include <iostream> #include <vector> using namespace std; int main() { int n; while(cin >> n){ &nb...
1
2
3
4
题目
八进制
题解数量
34
发布题解
在线答疑
热门题解
1
八进制 题解:
2
八进制 题解:为什么通过率只有百分之八十
3
八进制 题解:printf("%o\n",n);
4
八进制 题解:c++
5
八进制 题解:
6
八进制 (格式化输出)题解:
7
八进制 题解:孩子们,我秒了
8
“除x取余,逆序排列”
9
八进制 题解:
10
八进制 题解: