当前位置:网站首页>Pat grade a 1023 have fun with numbers
Pat grade a 1023 have fun with numbers
2022-06-27 02:52:00 【IX. non random address】
The number of digits of the value is greater than or equal to 20 position , Greater than long long The value range of string preservation
#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main(void){
string s, s0, sk;
int i, j, f, h;
cin>>s;
j = 0;
reverse(s.begin(), s.end());
for(int i=0; i<s.size(); i++){
h = (s[i] - '0') * 2 + j;
j = h/10;
f = h%10;
s0 += to_string(f);
if(i==(s.size() - 1) && (j > 0))
s0 += to_string(j);
}
reverse(s0.begin(), s0.end());
sk = s0;
sort(s.begin(), s.end());
sort(s0.begin(), s0.end());
if(s==s0) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
cout<<sk;
return 0;
}
边栏推荐
- Hot discussion: what are you doing for a meaningless job with a monthly salary of 18000?
- JWT certification process and use cases
- Precautions for using sneakemake
- 使用命令行安装达梦数据库
- Regular expressions: Syntax
- Uninstallation of Dameng database
- How does the C # TCP server limit the number of connections to the same IP?
- 栈溢出漏洞
- TopoLVM: 基于LVM的Kubernetes本地持久化方案,容量感知,动态创建PV,轻松使用本地磁盘
- dat. gui. JS star circle track animation JS special effect
猜你喜欢

Web development framework - Express (installation and use, static hosting, routing processing, use of Middleware)

Press key to control LED status reversal

PAT甲级 1020 Tree Traversals

STM32入门介绍

Flink learning 1: Introduction

Yuantou firm offer weekly record 20220627

发现一款 JSON 可视化工具神器,太爱了!

TopoLVM: 基于LVM的Kubernetes本地持久化方案,容量感知,动态创建PV,轻松使用本地磁盘

mmdetection 用yolox训练自己的coco数据集

Solve the problem of error reporting in cherry pick submission
随机推荐
mmdetection ValueError: need at least one array to concatenate解决方案
XSS attack (note)
Microsoft365开发人员申请
SQLite reader plug-in tests SQLite syntax
解决cherry pick提交报错问题
TP5 Spreadsheet Excle 表格导出
Enterprise digital transformation: informatization and digitalization
P5.js death planet
[Shangshui Shuo series] day 6
记录unity 自带读取excel的方法和遇到的一些坑的解决办法
TP5 spreadsheet excel table export
Leetcode 785: judgment bipartite graph
执念斩长河暑期规划
dat. gui. JS star circle track animation JS special effect
Mmdetection uses yolox to train its own coco data set
人群模拟
Questions and answers of chlor alkali electrolysis process in 2022
企业数字化转型:信息化与数字化
事业观、金钱观与幸福观
mmdetection 用yolox训练自己的coco数据集
https://github.com/ZouJiu1/PAT