当前位置:网站首页>Pat class a 1031 Hello world for u
Pat class a 1031 Hello world for u
2022-07-03 07:42:00 【IX. is it a non random title】
Pay attention to the calculation n1、n2、n3 Traverse , And the order of output
#include<iostream>
#include<vector>
#include<bits/stdc++.h>
using namespace std;
int main(int argc, char **argv){
string s, s0;
int i, j, k;
cin>>s;
int n1, n2, n3, maxmax = -999, l, mar;
l = s.length();
for(i = 3; i <= l; i++){
mar = 999;
for(j = i; j >= 0; j--){
if((j * 2 + i -2)== l){
mar = -999;
break;
}
}
if(mar < 0 && maxmax < j){
maxmax = j;
n2 = i;
}
}
n1 = n3 = maxmax;
for(i = 0; i < n1; i++){
cout<<s[i];
if(i != (n1 - 1))
for(j = 0; j < (n2 - 2); j++) cout<<" ";
else
for(j = 0; j < (n2 - 2); j++) cout<<s[i + j + 1];
cout<<s[l - i - 1]<<endl;
}
return EXIT_SUCCESS;
}边栏推荐
- 截图工具Snipaste
- Lucene merge document order
- Professor Zhang Yang of the University of Michigan is employed as a visiting professor of Shanghai Jiaotong University, China (picture)
- 研究显示乳腺癌细胞更容易在患者睡觉时进入血液
- 【MySQL 11】怎么解决MySQL 8.0.18 大小写敏感问题
- PAT甲级 1029 Median
- Es writing fragment process
- opensips与对方tls sip trunk对接注意事项
- 【MySQL 13】安装MySQL后第一次修改密码,可以可跳过MySQL密码验证进行登录
- Pgadmin 4 v6.11 release, PostgreSQL open source graphical management tool
猜你喜欢

昇思MindSpore再升级,深度科学计算的极致创新

Pat grade a 1029 median

技术干货|昇思MindSpore算子并行+异构并行,使能32卡训练2420亿参数模型

Go language foundation ----- 08 ----- interface

Collector in ES (percentile / base)

技术干货|昇思MindSpore NLP模型迁移之LUKE模型——阅读理解任务

Technical dry goods Shengsi mindspire lite1.5 feature release, bringing a new end-to-end AI experience

Go language foundation ----- 16 ----- goroutine, GPM model

【踩坑系列】mysql 修改root密码失败

Go language foundation ----- 19 ----- context usage principle, interface, derived context (the multiplexing of select can be better understood here)
随机推荐
技术干货 | AlphaFold/ RoseTTAFold开源复现(2)—AlphaFold流程分析和训练构建
HDMI2.1与HDMI2.0的区别以及转换PD信号。
PAT甲级 1029 Median
技术干货|昇思MindSpore NLP模型迁移之LUKE模型——阅读理解任务
哪一刻你才发现青春结束了
項目經驗分享:實現一個昇思MindSpore 圖層 IR 融合優化 pass
c语言指针的概念
Structure of golang
Analysis of the problems of the 10th Blue Bridge Cup single chip microcomputer provincial competition
Analysis of the problems of the 11th Blue Bridge Cup single chip microcomputer provincial competition
s7700设备如何清除console密码
Comparison of advantages and disadvantages between most complete SQL and NoSQL
Unity XR实现交互(抓取,移动旋转,传送,射击)-Pico
技术干货|昇思MindSpore算子并行+异构并行,使能32卡训练2420亿参数模型
Go language foundation ----- 06 ----- anonymous fields, fields with the same name
华为交换机:配置telnet和ssh、web访问
Technical dry goods Shengsi mindspire lite1.5 feature release, bringing a new end-to-end AI experience
Sent by mqtt client server of vertx
Partage de l'expérience du projet: mise en œuvre d'un pass optimisé pour la fusion IR de la couche mindstore
Go language - loop statement
https://github.com/ZouJiu1/PAT