当前位置:网站首页>PAT甲级 1019 General Palindromic Number
PAT甲级 1019 General Palindromic Number
2022-06-27 02:44:00 【九是否非随机的称呼】
进制可能大于10,所以要用数组存a
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<bits/stdc++.h>
using namespace std;
int main(){
long long a, w, c;
int x, y, m;
cin>>a>>c;
string s, s0;
vector<int> v, v0;
w = a;
if(w==0) s+='0';
while(w!=0){
w = a/c;
y = a%c;
s += to_string(y);
v.push_back(y);
a= w;
}
v0 = v;
reverse(v.begin(), v.end());
if(v0==v) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
for(int i=0; i<v.size(); i++){
cout<<v[i];
if(i!=(v.size()-1)) cout<<" ";
}
return 0;
}边栏推荐
- I earned 3W yuan a month from my sideline: the industry you despise really makes money!
- Introduction to stm32
- 参数估计——《概率论及其数理统计》第七章学习报告(点估计)
- Quicksand painting simulator source code
- Record the method of reading excel provided by unity and the solution to some pits encountered
- 记录unity 自带读取excel的方法和遇到的一些坑的解决办法
- Fork (), exec (), waitpid (), $? > > in Perl 8 combination
- 2022中式面点师(高级)复训题库及在线模拟考试
- How does the brain do arithmetic? Both addition and subtraction methods have special neurons, and the symbol text can activate the same group of cell sub journals
- paddlepaddle 19 动态修改模型的最后一层
猜你喜欢

Docker deploy redis cluster

SQLite reader plug-in tests SQLite syntax

lottie.js创意开关按钮动物头像

Mmdetection uses yolox to train its own coco data set

Flink学习3:数据处理模式(流批处理)

Parameter estimation -- Chapter 7 study report of probability theory and mathematical statistics (point estimation)

QIngScan使用

Flink学习4:flink技术栈

Detailed explanation of ThreadLocal

How does the brain do arithmetic? Both addition and subtraction methods have special neurons, and the symbol text can activate the same group of cell sub journals
随机推荐
Web development framework - Express (installation and use, static hosting, routing processing, use of Middleware)
人群模拟
Yiwen teaches you Kali information collection
Laravel 的 ORM 缓存包
Introduction to stm32
Oracle/PLSQL: Cast Function
学习太极创客 — MQTT 第二章(一)QoS 服务质量等级
Paddlepaddle 19 dynamically modify the last layer of the model
Calculation of average wind direction and speed (unit vector method)
Oracle/PLSQL: Rpad Function
bluecms代码审计入门
Brief introduction of 228 dropout methods of pytorch and fast implementation of dropblock with 4 lines of code based on dropout
Why pass SPIF_ Sendchange flag systemparametersinfo will hang?
执念斩长河暑期规划
mmdetection 用yolox训练自己的coco数据集
学习太极创客 — MQTT(九)ESP8266 同时订阅和发布 MQTT 消息
Don't be brainwashed. This is the truth about the wages of 90% of Chinese people
Flink学习4:flink技术栈
Test the respective roles of nohup and &
1、项目准备与新建
https://github.com/ZouJiu1/PAT