当前位置:网站首页>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;
}
边栏推荐
- Paddlepaddle 19 dynamically modify the last layer of the model
- 一文教你Kali信息收集
- LeetCode 785:判断二分图
- 解决cherry pick提交报错问题
- 清华&华为等 综述 | 语义通信:原则与挑战
- Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
- Super detailed, 20000 word detailed explanation, thoroughly understand es!
- Don't be brainwashed. This is the truth about the wages of 90% of Chinese people
- ConstraintLayout(约束布局)开发指南
- 455. distribute biscuits [distribution questions]
猜你喜欢
流沙画模拟器源码
Calculation of average wind direction and speed (unit vector method)
Learning Tai Chi Maker - mqtt Chapter 2 (II) esp8266 QoS application
pytorch_ grad_ Cam -- visual Library of class activation mapping (CAM) under pytorch
Flink learning 5: how it works
[Shangshui Shuo series] day 6
学习太极创客 — MQTT 第二章(二)ESP8266 QoS 应用
Learn Tai Chi Maker - mqtt (VIII) esp8266 subscribe to mqtt topic
Google began to roll itself, AI architecture pathways was blessed, and 20billion generation models were launched
Parameter estimation -- Chapter 7 study report of probability theory and mathematical statistics (point estimation)
随机推荐
Memcached basics 11
h5液体动画js特效代码
[array] sword finger offer II 012 The sum of left and right subarrays is equal | sword finger offer II 013 Sum of two dimensional submatrix
Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
How to solve the problem of low applet utilization
QIngScan使用
元透实盘周记20220627
lodash get js代码实现
平均风向风速计算(单位矢量法)
Learning Tai Chi Maker - mqtt Chapter 2 (II) esp8266 QoS application
docker部署redis集群
YaLM 100B:来自俄罗斯Yandex的1000亿参数开源大模型,允许商业用途
Laravel 的 ORM 缓存包
Flink學習2:應用場景
Google began to roll itself, AI architecture pathways was blessed, and 20billion generation models were launched
JWT certification process and use cases
Learn from Taiji Maker - mqtt Chapter 2 (I) QoS service quality level
Hot discussion: what are you doing for a meaningless job with a monthly salary of 18000?
TopoLVM: 基于LVM的Kubernetes本地持久化方案,容量感知,动态创建PV,轻松使用本地磁盘
执念斩长河暑期规划