当前位置:网站首页>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;
}
边栏推荐
- GCC: Graph Contrastive Coding for Graph Neural NetworkPre-Training
- 想请教一下,我在东莞,到哪里开户比较好?手机开户是安全么?
- 【实习】解决请求参数过长问题
- Implementation of online shopping mall system based on SSM
- Research Report on the overall scale, major manufacturers, major regions, products and applications of hollow porcelain insulators in the global market in 2022
- I did a craniotomy experiment: talk about macromolecule coding theory and Lao Wang's fallacy from corpus callosum and frontal leukotomy
- Driverless learning (4): Bayesian filtering
- Research Report on the overall scale, major manufacturers, major regions, products and applications of outdoor vacuum circuit breakers in the global market in 2022
- 【Hot100】23. 合并K个升序链表
- esp32c3 crash分析
猜你喜欢
Motivation! Big Liangshan boy a remporté le prix Zhibo! Un article de remerciement pour les internautes qui pleurent
Postman interface test practice, these five questions you must know
Conscience summary! Jupyter notebook from Xiaobai to master, the nanny tutorial is coming!
Attack and defense world PWN question: Echo
Second hand housing data analysis and prediction system
Postman接口测试实战,这5个问题你一定要知道
The first of the classic quotations of correspondents is heartbreaking
Implementation of online shopping mall system based on SSM
【Hot100】21. 合并两个有序链表
[871. Minimum refueling times]
随机推荐
sql-labs
[译]深入了解现代web浏览器(一)
Cron表达式(七子表达式)
[fluent] dart function (function composition | private function | anonymous function | function summary)
Esp32c3 crash analysis
Research Report on the overall scale, major manufacturers, major regions, products and applications of battery control units in the global market in 2022
burp 安装 license key not recognized
sense of security
Attack and defense world PWN question: Echo
证券如何在线开户?手机开户是安全么?
pytorch 模型保存的完整例子+pytorch 模型保存只保存可訓練參數嗎?是(+解决方案)
Google Earth Engine(GEE)——Landsat 9影像全波段影像下载(北京市为例)
In depth understanding of modern web browsers (I)
for(auto a : b)和for(auto &a : b)用法
【实习】解决请求参数过长问题
Istio deployment: quickly start microservices,
Redis sentinel cluster working principle and architecture deployment # yyds dry goods inventory #
[QT] QPushButton creation
Research Report on the overall scale, major manufacturers, major regions, products and applications of metal oxide arresters in the global market in 2022
B端电商-订单逆向流程