题解 2818: 分离整数的各个数位(while循环的引入) 摘要:解题思路:还记得如何分离整数的各个数位吗?//以三位数为例 cout<<n%10<<endl; cout<<n/10%10<<endl; cout<<n/10/10%10<<endl;但本题中,…… 题解列表 2023年07月12日 2 点赞 0 评论 1817 浏览 评分:6.3
题解 2818: 分离整数的各个数位 摘要:解题思路:首先读取输入的整数 n。使用循环,当 n 不为 0 时执行以下步骤。在循环中,将 n 对 10 取余数,得到当前的个位数字。输出该数字,并在后面加上一个空格。将 n 除以 10,去掉已经处理…… 题解列表 2024年01月16日 0 点赞 0 评论 570 浏览 评分:6.0
2818: 分离整数的各个数位 摘要:解题思路:注意事项:参考代码:n = str(input())for i in range(len(n)-1,-1,-1): print(n[i],end=" ")…… 题解列表 2024年07月30日 0 点赞 0 评论 671 浏览 评分:0.0
旧物有情 #2818: 分离整数的各个数位 字符串翻转法 和 模拟法 [TOC]这道题目的数据范围比较弱,不存在类似于10000这种需要我们考虑前导0的问题不过大家可以思考一下如何去除前导0#字符串翻转法```#includeusingnamespacestd;intmain(){strings;cin>>s;reverse(s.begin(), 题解列表 2024年10月17日 0 点赞 0 评论 493 浏览 评分:0.0
编写题解 2818: 分离整数的各个数位 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){long long a; cin>>a;while(a){co…… 题解列表 2024年05月26日 0 点赞 0 评论 621 浏览 评分:0.0
C++分离整数的各个位数 解题思路:注意事项:参考代码:#include#include#include#includeusingnamespacestd;intmain(void){intn;cin>>n;intsum=n;intcount=0;if( 题解列表 2026年03月03日 0 点赞 0 评论 288 浏览 评分:0.0
题解 2818: 分离整数的各个数位 c++ 摘要:解题思路:自己想注意事项:别抄我的,抄我的人我诅咒他电脑10秒关机参考代码:#include<bits/stdc++.h>#include<windows.h>using namespace std;…… 题解列表 2024年02月26日 0 点赞 0 评论 646 浏览 评分:0.0
2818 while解法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a; int x,y; scanf("%d",&a); x=a; whil…… 题解列表 2024年10月19日 0 点赞 0 评论 592 浏览 评分:0.0
2025/8/1刷题记录 摘要:解题思路:通过%10取出个位数 通过/10消除个位数注意事项:参考代码:#include<stdio.h>int main(){ //y记录最后一位数字 …… 题解列表 2025年08月01日 0 点赞 0 评论 375 浏览 评分:0.0