当前位置:网站首页>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;
}
边栏推荐
- 2022 operation of simulated examination platform for tea artist (Senior) work license question bank
- Getting started with bluecms code auditing
- 2022中式面点师(高级)复训题库及在线模拟考试
- Questions and answers of chlor alkali electrolysis process in 2022
- 1. Project preparation and creation
- Microsoft365 developer request
- Flink学习2:应用场景
- PAT甲级 1020 Tree Traversals
- 企业数字化转型:信息化与数字化
- PAT甲级 1021 Deepest Root
猜你喜欢

Super detailed, 20000 word detailed explanation, thoroughly understand es!

PAT甲级 1026 Table Tennis

Geometric distribution (a discrete distribution)

Flink学习5:工作原理

Google began to roll itself, AI architecture pathways was blessed, and 20billion generation models were launched

Flink learning 2: application scenarios

Look! In June, 2022, the programming language ranking list was released! The first place is awesome

超級詳細,2 萬字詳解,吃透 ES!

Press key to control LED status reversal

Learning Tai Chi Maker - mqtt (VII) advanced mqtt theme
随机推荐
Flink learning 5: how it works
Enterprise digital transformation: informatization and digitalization
人群模拟
CVPR2022 | PointDistiller:面向高效紧凑3D检测的结构化知识蒸馏
平均风向风速计算(单位矢量法)
three.js多米诺骨牌js特效
YaLM 100B:来自俄罗斯Yandex的1000亿参数开源大模型,允许商业用途
lottie. JS creative switch button animal head
XSS attack (note)
TP5 spreadsheet excel table export
Google began to roll itself, AI architecture pathways was blessed, and 20billion generation models were launched
Learning Tai Chi Maker - mqtt (VII) advanced mqtt theme
C # check whether the date is in the correct format
Getting started with bluecms code auditing
Flink learning 4:flink technology stack
Why pass SPIF_ Sendchange flag systemparametersinfo will hang?
Learn Tai Chi Maker - mqtt Chapter 2 (3) reserved messages
Flink learning 2: application scenarios
455. distribute biscuits [distribution questions]
C# Tcp服务器如何限制同一个IP的连接数量?
https://github.com/ZouJiu1/PAT