Tom数 (C语言代码)新手进,易懂,大佬勿喷。 摘要:解题思路:利用字符串读入,再利用for循环逐字符读出,将字符型0-9转换成整型0-9,最后实现累加。注意事项:注意输入输出格式,防止超限。参考代码:#include<stdio.h> #includ…… 题解列表 2018年03月28日 1 点赞 0 评论 967 浏览 评分:0.0
Tom数 (Java代码) 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main { public static void main(String[] args) {…… 题解列表 2018年04月05日 1 点赞 0 评论 1098 浏览 评分:0.0
[推荐]题解1118:Tom数 用ascii码(Java代码) 摘要:解题思路:1.读入string 用 toCharArray 拆分成char数组,再减去48即可注意事项:注意:需要循环读入 while (scanner.hasNext()) { }参考代码:im…… 题解列表 2018年05月14日 1 点赞 0 评论 1161 浏览 评分:0.0
Tom数 (C语言代码)(转字符) 摘要:解题思路: 转换为字符串遍历相加参考代码:#include <stdio.h> #include <stdring.h> int main() { char numc[11]…… 题解列表 2018年06月03日 0 点赞 0 评论 862 浏览 评分:0.0
Tom数 (C++代码) 摘要:#include <iostream> #include <cmath> using namespace std; long long n; int main() { whil…… 题解列表 2018年06月21日 7 点赞 0 评论 1028 浏览 评分:0.0
Tom数 (Java代码) 摘要:解题思路:注意事项:要考虑负数的情况,别被题目迷惑参考代码:import java.util.Scanner;public class Main { public static void main(S…… 题解列表 2018年07月06日 0 点赞 0 评论 1016 浏览 评分:0.0
此解可AC(超简单) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int c, sum; unsigned int N; while (scanf("%u", &N) != EO…… 题解列表 2018年07月16日 3 点赞 0 评论 968 浏览 评分:0.0
Tom数 C语言 字符串 mirage解题记录 摘要:解题思路:1. 读入数据储存为字符串。2. 挨个字符相加得出结果。注意事项:单个字符相加时减去'0'的ASCLL码值。参考代码:#include<stdio.h> int main(…… 题解列表 2018年08月04日 19 点赞 3 评论 594 浏览 评分:0.0
Tom数 (C++代码) 摘要:解题思路:利用stringstream把字符和数字进行安全的转换注意事项:不考虑超限的话,把a[11]改为a[10000]有非常惊奇的效果参考代码:#include <iostream>#includ…… 题解列表 2018年08月10日 0 点赞 0 评论 900 浏览 评分:0.0
Tom数 (C语言代码) 摘要:解题思路:注意事项:注意sum重新置为零,注意字符类型为long long参考代码:#include<stdio.h>int main(){ int long long n,m,sum=0; whi…… 题解列表 2018年09月01日 0 点赞 0 评论 645 浏览 评分:0.0