博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PAT_A 1005. Spell It Right (20)
阅读量:4226 次
发布时间:2019-05-26

本文共 992 字,大约阅读时间需要 3 分钟。

1005. Spell It Right (20)

时间限制
400 ms
内存限制
65536 kB
代码长度限制
16000 B
判题程序
Standard
作者
CHEN, Yue

Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.

Input Specification:

Each input file contains one test case. Each case occupies one line which contains an N (<= 10100).

Output Specification:

For each test case, output in one line the digits of the sum in English words. There must be one space between two consecutive words, but no extra space at the end of a line.

Sample Input:
12345
Sample Output:
one five
import java.util.*;public class Main {  public static void main(String[] args) {    // TODO Auto-generated method stub    Scanner in=new Scanner(System.in);    int sum=0;    int len;    int sum_len;    String E[]= {"zero","one","two","three","four","five","six","seven","eight","nine"};    String s=new String("");    String sum_s=new String("");    s=in.nextLine();    len=s.length();    for(int i=0;i

转载地址:http://htdqi.baihongyu.com/

你可能感兴趣的文章
(一).postman学习——前期知识准备
查看>>
qt入门级使用
查看>>
Web Stotage——本地储存详解及案例
查看>>
File Reader文件操作
查看>>
地理位置服务——navigator.geolocation
查看>>
地理位置服务——百度地图API
查看>>
js拖放事件详解及实战
查看>>
js字符串常用属性与方法
查看>>
C++递归算法案例
查看>>
C++算法——异或运算解决出现次数问题
查看>>
C++数据结构——顺序栈(基本代码实现与案例)
查看>>
C++数据结构——链队列(基本代码实现与案例)
查看>>
C++数据结构——顺序表的查找(简单顺序查找、有序表的二分查找、索引顺序的查找)
查看>>
Hive 常用统计查询语句
查看>>
对象存储产生背景、发展历史、原理架构、优缺点、应用场景及开源项目对比
查看>>
Apache Ozone 分布式对象存储系统相关文档汇总
查看>>
Ozone 与 HDDS 的区别与联系
查看>>
maven失败测试用例rerun插件使用方法
查看>>
Python基础(三)
查看>>
Python入门NLP(二)
查看>>