当前位置:网站首页>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
- Unity XR实现交互(抓取,移动旋转,传送,射击)-Pico
- 技术干货|昇思MindSpore NLP模型迁移之LUKE模型——阅读理解任务
- Go language foundation ----- 02 ----- basic data types and operators
- OSPF experiment
- 论文学习——鄱阳湖星子站水位时间序列相似度研究
- VMware network mode - bridge, host only, NAT network
- Pat class a 1030 travel plan
- Sent by mqtt client server of vertx
- 华为交换机:配置telnet和ssh、web访问
猜你喜欢
技术干货|昇思MindSpore初级课程上线:从基本概念到实操,1小时上手!
研究显示乳腺癌细胞更容易在患者睡觉时进入血液
【LeetCode】2. Valid Parentheses·有效的括号
Technical dry goods | alphafold/ rosettafold open source reproduction (2) - alphafold process analysis and training Construction
VMware network mode - bridge, host only, NAT network
Go language foundation ------ 14 ------ gotest
Go language foundation ----- 08 ----- interface
Hnsw introduction and some reference articles in lucene9
Go language foundation ----- 04 ----- closure, array slice, map, package
Technology dry goods | luxe model for the migration of mindspore NLP model -- reading comprehension task
随机推荐
[coppeliasim4.3] C calls UR5 in the remoteapi control scenario
Unity XR实现交互(抓取,移动旋转,传送,射击)-Pico
Inverted chain disk storage in Lucene (pfordelta)
How long is the fastest time you can develop data API? One minute is enough for me
微软安全响应中心
【MySQL 12】MySQL 8.0.18 重新初始化
【MySQL 14】使用DBeaver工具远程备份及恢复MySQL数据库(Linux 环境)
华为交换机基础配置(telnet/ssh登录)
Image recognition and detection -- Notes
华为交换机Console密码重置、设备初始化、默认密码
Analysis of the problems of the 11th Blue Bridge Cup single chip microcomputer provincial competition
Analysis of the problems of the 10th Blue Bridge Cup single chip microcomputer provincial competition
Technology dry goods | luxe model for the migration of mindspore NLP model -- reading comprehension task
opensips与对方tls sip trunk对接注意事项
技术干货|利用昇思MindSpore复现ICCV2021 Best Paper Swin Transformer
Project experience sharing: realize an IR Fusion optimization pass of Shengsi mindspire layer
s7700设备如何清除console密码
PHP微信抢红包的算法
图像识别与检测--笔记
一篇文章让你读懂-曼彻斯特编码