当前位置:网站首页>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;
}边栏推荐
- 勵志!大凉山小夥全獎直博!論文致謝看哭網友
- 【Hot100】21. Merge two ordered linked lists
- Detailed explanation of VBScript (I)
- 攻防世界pwn题:Recho
- Web3js method to obtain account information and balance
- 现在券商的优惠开户政策什么?实际上网上开户安全么?
- Redis sentinel cluster working principle and architecture deployment # yyds dry goods inventory #
- Google Earth engine (GEE) - Landsat 9 image full band image download (Beijing as an example)
- [kubernetes series] comparison of space and memory usage before and after kubedm reset initialization
- 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
猜你喜欢

c语言链表--待补充

Istio deployment: quickly start microservices,

Burp install license key not recognized

【每日一题】241. 为运算表达式设计优先级

How to do interface testing? After reading this article, it will be clear

burp 安装 license key not recognized

B-end e-commerce - reverse order process

Wu Enda's machine learning mind mapping insists on clocking in for 23 days - building a knowledge context, reviewing, summarizing and replying

Taiwan SSS Xinchuang sss1700 replaces cmmedia cm6533 24bit 96KHz USB audio codec chip

JDBC | Chapter 4: transaction commit and rollback
随机推荐
【Hot100】22. bracket-generating
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
Research Report on the overall scale, major manufacturers, major regions, products and application segmentation of power management units in the global market in 2022
What are the benefits of multi terminal applet development? Covering Baidu applet, Tiktok applet, wechat applet development, and seizing the multi platform traffic dividend
Research Report on the overall scale, major manufacturers, major regions, products and applications of hollow porcelain insulators in the global market in 2022
Talk about macromolecule coding theory and Lao Wang's fallacy from the perspective of evolution theory
JASMINER X4 1U deep disassembly reveals the secret behind high efficiency and power saving
攻防世界pwn题:Recho
Driverless learning (III): Kalman filter
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
Resunnet - tensorrt8.2 Speed and Display record Sheet on Jetson Xavier NX (continuously supplemented)
How to do interface testing? After reading this article, it will be clear
Outsourcing for three years, abandoned
Is it safe to open an account for online stock speculation? I'm a novice, please guide me
Taiwan SSS Xinchuang sss1700 replaces cmmedia cm6533 24bit 96KHz USB audio codec chip
Use IDM to download Baidu online disk files (useful for personal testing) [easy to understand]
Use graalvm native image to quickly expose jar code as a native shared library
Research Report on the overall scale, major manufacturers, major regions, products and applications of outdoor vacuum circuit breakers in the global market in 2022
Spark source code compilation, cluster deployment and SBT development environment integration in idea
SBT tutorial