b每次左移一位,为a的个位数求模留出空间 摘要:解题思路:建立新变量b=0。由于b的值是累加不断更新,因此初始值需要是0。循环逻辑:b每次左移一位,为a的个位数求模留出空间。数值更新:a每次同样左移,不断保存前一位的值,回溯到上面的循环里。参考代码…… 题解列表 2024年12月06日 0 点赞 0 评论 263 浏览 评分:0.0
C语言函数解决-不考虑前导0的情况 摘要:解题思路:注意事项:参考代码:#include<stdio.h> void kr(int n); int main() { int n; scanf("%d",&n…… 题解列表 2022年11月28日 0 点赞 0 评论 364 浏览 评分:0.0
2819: 数字反转 摘要:解题思路:注意事项:参考代码:n = int(input())if n >= 0: s = str(n)[::-1] print(int(s))else: n = -n s =…… 题解列表 2024年07月30日 0 点赞 0 评论 373 浏览 评分:0.0
编写题解 2819: 数字反转 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){long long n,m=0; cin>>n;while(n…… 题解列表 2024年05月14日 0 点赞 0 评论 590 浏览 评分:0.0
题解 2819:数字反转 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main { public static void main(String[] args…… 题解列表 2023年10月13日 0 点赞 0 评论 470 浏览 评分:0.0
2819: 数字反转 摘要:参考代码:n = input() if n[0] == '-': print('-' + str(int(n[1:][::-1]))) else: …… 题解列表 2024年03月17日 1 点赞 0 评论 356 浏览 评分:0.0
编写题解 2819: 数字反转 摘要:解题思路:注意事项:参考代码:n=input()fn=str(abs(int(n)))#取整+绝对值+字符串,避免‘-’的影响r=0#反转新数for j in range(len(fn)-1,-1,-…… 题解列表 2024年03月02日 0 点赞 0 评论 430 浏览 评分:0.0
编写题解 2819: 数字反转 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ long long n,ans=0; cin>…… 题解列表 2024年02月26日 0 点赞 0 评论 330 浏览 评分:0.0
编写题解 2819: 数字反转编写题解 2819: 数字反转编写题解 2819: 数字反转编写题解 2819: 数字反转编写题解 2819: 数字反转 摘要:解题思路:1. 首先定义一个变量 ans 并将其初始化为 0,用于存储反转后的数字。2. 通过循环遍历给定的整数 n,直到 n 变为 0。3. 在循环中,将 ans 左移一位(乘以 10),并加上 n…… 题解列表 2024年01月16日 1 点赞 0 评论 281 浏览 评分:0.0
题解 2819: 数字反转 摘要:解题思路:注意事项:参考代码:#include <iostream>//忘用万能头了using namespace std;int main(){ long long a;//数大,int装不下…… 题解列表 2024年01月16日 1 点赞 0 评论 275 浏览 评分:0.0