pat1005
来源:互联网 发布:战地4同步云数据 编辑:程序博客网 时间:2024/06/14 03:19
package AdvancedLevelPractice;import java.util.Scanner;public class pat1005 {public static void main(String[] args) {// TODO Auto-generated method stubScanner scanner = new Scanner(System.in);String[] digitStrings = {"zero","one","two","three","four","five","six","seven","eight","nine"};String inputString = scanner.next();int sum = 0;for(int i = 0; i < inputString.length(); i++ ){sum += inputString.charAt(i) - '0';}int[] sumInt = new int[4];int index = 0;while(sum != 0){sumInt[index++] = sum % 10;sum /= 10;}for(int i = index - 1; i > 0; i--){System.out.print(digitStrings[sumInt[i]]+" ");}System.out.print(digitStrings[sumInt[0]]);scanner.close();}}
0 0
- PAT1005
- pat1005
- pat1005
- Pat1005
- PAT1005
- pat1005
- 浙大PAT1005
- PAT1005.Spell It Right
- PAT1005. Spell It Right
- pat1005 Spell It Right
- PAT1005(A)
- PAT1005-The Largest Generation
- 浙江大学乙级PAT1005
- PAT1005-Spell It Right
- PAT1005. Spell It Right (20)
- PAT1005. Spell It Right (20)
- PAT1005. Spell It Right (20)
- PAT1005. Spell It Right (20)
- c++ obj文件与exe文件的区别
- pat1004
- Android5.0的更新包中system.new.dat文件的打包
- 将索引移动到别的表空间
- 数据结构实验1——顺序表
- pat1005
- [算法系列] 求生之路(迷宫找出口)
- pat1006
- exynos4412 HDMI测试
- 为什么选择go语言?go语言的优势
- iBatis教程之CRUD操作
- pat1007
- [置顶] IT牛人博客
- IOS中UITableViewController使用注意点