当前位置:网站首页>1005 spell it right (20 points) "PTA class a exercise"
1005 spell it right (20 points) "PTA class a exercise"
2022-07-02 20:32:00 【Yang tree Yang tree】
Pay attention to 0 In special circumstances
AC Code :
#include <cstring>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#define dd double
#define PII pair<int,int>
#define int long long
#define ll long long
using namespace std;
const dd eps = 1e-6;
const int mod = 998244353;
const int N = 1e5+10;
string a;
char b[N];
int tot;
signed main()
{
cin>>a;
int ans = 0;
int len = a.length();
for(int i=0;i<len;i++)
{
ans += a[i] - '0';
}
while(ans!=0)
{
int m = ans % 10;
b[++tot]='0'+m;
ans /= 10;
}
int ddd=1;
for(int i=tot;i>=1;i--)
{
if(b[i]=='0') printf("zero");
if(b[i]=='1') printf("one");
if(b[i]=='2') printf("two");
if(b[i]=='3') printf("three");
if(b[i]=='4') printf("four");
if(b[i]=='5') printf("five");
if(b[i]=='6') printf("six");
if(b[i]=='7') printf("seven");
if(b[i]=='8') printf("eight");
if(b[i]=='9') printf("nine");
if(i!=1) printf(" ");
ddd=0;
}
if(a[0]=='0'&&ddd==1) printf("zero");
return 0;
}边栏推荐
- Database schema notes - how to choose the right database in development + who invented relational database?
- Outsourcing for three years, abandoned
- Function, function, efficiency, function, utility, efficacy
- at编译环境搭建-win
- CheckListBox control usage summary
- How to realize the function of detecting browser type in Web System
- I did a craniotomy experiment: talk about macromolecule coding theory and Lao Wang's fallacy from corpus callosum and frontal leukotomy
- Research Report on the overall scale, major manufacturers, major regions, products and application segmentation of multi-channel signal conditioners in the global market in 2022
- 有时候只查询一行语句,执行也慢
- 【QT】QPushButton创建
猜你喜欢

Self-Improvement! Daliangshan boys all award Zhibo! Thank you for your paper

CRM Customer Relationship Management System

Postman接口测试实战,这5个问题你一定要知道

【NLP】一文详解生成式文本摘要经典论文Pointer-Generator

测试人员如何做不漏测?这7点就够了
![[QT] QPushButton creation](/img/c4/bc0c346e394484354e5b9d645916c0.png)
[QT] QPushButton creation

【实习】解决请求参数过长问题

Sometimes only one line of statements are queried, and the execution is slow
![[871. Minimum refueling times]](/img/5f/75e717d1fc9d1c5f9e1d8f59dda38c.png)
[871. Minimum refueling times]

【871. 最低加油次数】
随机推荐
Postman interface test practice, these five questions you must know
Automatic reading of simple books
【Kubernetes系列】kubeadm reset初始化前后空间、内存使用情况对比
Cron expression (seven subexpressions)
For (Auto A: b) and for (Auto & A: b) usage
[Chongqing Guangdong education] reference materials for labor education of college students in Nanjing University
What are the benefits of multi terminal applet development? Covering Baidu applet, Tiktok applet, wechat applet development, and seizing the multi platform traffic dividend
JDBC | Chapter 3: SQL precompile and anti injection crud operation
JDBC | Chapter 4: transaction commit and rollback
How to open an account online? Is it safe to open a mobile account?
【Hot100】22. bracket-generating
自动化制作视频
Exemple complet d'enregistrement du modèle pytoch + enregistrement du modèle pytoch seuls les paramètres d'entraînement sont - ils enregistrés? Oui (+ Solution)
B端电商-订单逆向流程
Research Report on the overall scale, major manufacturers, major regions, products and application segmentation of the inverted front fork of the global market in 2022
GCC: Graph Contrastive Coding for Graph Neural NetworkPre-Training
One side is volume, the other side is layoff. There are a lot of layoffs in byte commercialization department. What do you think of this wave?
Driverless learning (III): Kalman filter
Detailed explanation of VBScript (I)
疫情封控65天,我的居家办公心得分享 | 社区征文