Tom数-三种解法 摘要:参考代码://题目比较简单,但要注意细节,仔细看看整数的范围 public void Tom1 () { Scanner sc = new Scanner(System.in); …… 题解列表 2021年09月29日 0 点赞 0 评论 628 浏览 评分:0.0
题解 1118: Tom数 摘要:解题思路:使用 int的话只能对一半,使用数组来存取数才可以存下去很大的数注意事项:参考代码:#include <stdio.h>#include <string.h>int main(){ ch…… 题解列表 2021年10月15日 0 点赞 0 评论 914 浏览 评分:0.0
1118: Tom数-题解(python) 摘要:解题思路:注意事项:参考代码:while True: a = input() l = [] for i in a: l.append(int(i)) m = su…… 题解列表 2021年10月19日 0 点赞 0 评论 487 浏览 评分:0.0
C++简单易懂,整除和取余 摘要:解题思路:看代码注释!!!参考代码:#include<bits/stdc++.h> using namespace std; int main(){ long long n; whil…… 题解列表 2021年11月03日 0 点赞 0 评论 1217 浏览 评分:0.0
编写题解 1118: Tom数 摘要:解题思路:注意事项:参考代码:while True: try: n = str(input()) sum = 0 for i in n: …… 题解列表 2021年12月10日 0 点赞 0 评论 933 浏览 评分:0.0
无穷大也可以算,不需要数组 摘要:int main(){ char c; int state = 0; int sum = 0; while((state = scanf("%c", &c)) != EOF){ …… 题解列表 2022年01月23日 0 点赞 0 评论 619 浏览 评分:0.0
Hifipsysta-1118题-Tom数(C++代码)字符串法 ```cpp#include#include#includeusingnamespacestd;intmain(){stringstr;while(getline(cin,str)){intsum=0;for(inti=0;i 题解列表 2022年01月30日 0 点赞 0 评论 500 浏览 评分:0.0
明明白白的 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ long int n; while (scanf("%d", &n) != EOF) { long int s…… 题解列表 2022年02月07日 0 点赞 0 评论 571 浏览 评分:0.0
1118: Tom数 java代码 应该算作入门题,不应该放在这里```actionscriptimportjava.util.Scanner;publicclassMain{publicstaticvoidmain(String[]args){Scannerscan=newScanner(System.in);while(scan.h 题解列表 2022年02月27日 0 点赞 0 评论 533 浏览 评分:0.0
Tom数(我来用Java写) 摘要:解题思路: 将字符串变成字符数组,再变成一个个单字母的字符串,最后用Integer.valueOf()变成整型。注意事项:注意要用long来表示,防止超界。参考代码:import java.util.…… 题解列表 2022年03月06日 0 点赞 0 评论 500 浏览 评分:0.0