- 浏览: 36650 次
- 性别:
- 来自: 杭州
最新评论
PAT1031 Hello World for U
- 博客分类:
- PAT
Sample Input:
helloworld!
Sample Output:
h ! e d l l lowor
#include <iostream> #include <iomanip> #include <string> using namespace std; int main() { string str; cin>>str; int length = str.length(); int n1 = length/3; int n2; if (length%3 == 0) { n1--; n2 = n1 + 3; } else { n2 = n1 + length%3; } for (int i = 0; i < n1; i++) { cout<<str[i]; for (int j = 0; j < n2 - 2; j++) { cout<<" "; } cout<<str[length - 1 -i]<<endl; } for (int i = length - n1 - n2; i < length - n1; i++) { cout<<str[i]; } return 0; }
发表评论
-
PAT1013 Battle Over Cities
2012-11-29 23:59 773Sample Input 3 2 3 1 2 1 3 ... -
PAT1003 Emergency
2012-11-29 23:46 662Sample Input 5 6 0 2 1 2 1 ... -
PAT1041 Be Unique
2012-11-23 23:43 760找出只出现过一次的数,用各种排序必然超时,需要用数组做hash ... -
PAT1042 Shuffling Machine
2012-11-23 23:42 733扑克洗牌 #include < ... -
PAT1040 Longest Symmetric String
2012-11-23 23:41 959求最长回文子串 #include < ... -
PAT1036 Boys vs Girls
2012-11-23 23:41 716Sample Input 1: 3 Joe M Mat ... -
PAT1035 Password
2012-11-23 23:40 616Sample Input 1: 3 Team0000 ... -
PAT1029 Median
2012-11-22 23:54 651用标准库的排序全部超时,需要自己实现,另外还不能用cin co ... -
PAT1028 List Sorting
2012-11-22 23:53 808用vector最后一个用例超时了。。。 Sample ... -
PAT1027 Colors in Mars
2012-11-22 23:52 623Sample Input 15 43 71 Samp ... -
PAT1025 PAT Ranking
2012-11-22 23:51 772Sample Input: 2 5 123456789 ... -
PAT1023 Have Fun with Numbers
2012-11-21 23:55 687大数的相加 比较两个字符串中字符完全相同 Sa ... -
PAT1020 Tree Traversals
2012-11-21 23:54 652已知中序遍历 后序遍历,求层次遍历 Sample In ... -
PAT1019 General Palindromic Number
2012-11-21 23:53 537十进制转任意进制,并比较是否是回文数 Sample I ... -
PAT1037 Magic Coupon
2012-11-21 15:46 663Sample Input: 4 1 2 4 -1 ... -
PAT1038 Recover the Smallest Number
2012-11-20 23:52 1668由一道面试题改的 把数组排成最小的数 不同之处是这 ... -
PAT1024 Palindromic Number
2012-11-20 23:51 648Sample Input 1: 67 3 Sampl ... -
PAT1015 Reversible Primes
2012-11-19 23:51 771十进制转任意进制 假设十进制数为number,转 ... -
PAT1012 The Best Rank
2012-11-19 23:50 927四门功课,输出排名最高的是哪个 Sample Inpu ... -
PAT1011 World Cup Betting
2012-11-19 23:50 534Sample Input 1.1 2.5 1.7 1.2 ...
相关推荐
dcu2pat,make Delphi .dcu to .pat!! http://redplait.blogspot.com/2013/05/dcu2pat.html I wrote today some simple hack tool for creating signatures from delphi .dcu files for IDA flair The main idea is ...
dcu2pat,make Delphi .dcu to .pat!! http://redplait.blogspot.com/2013/05/dcu2pat.html I wrote today some simple hack tool for creating signatures from delphi .dcu files for IDA flair The main idea is ...
CAD填充图案(三百多种)-.pat文件 部分如下(篇幅有限) 2x12木地板.pat 45度人字形砖面(1).pat 8x8无缝砖.pat Z形砖.pat 丁字砖面1.pat 丁字砖面2.pat 三联蜂窝.pat 三角形拼铺.pat 不能通行的沼泽地.pat 乱沙.pat...
PAT基本数据结构题_队列,栈,链表,二叉树,并查集等 1. 1104. Sum of Number Segments 题目描述 https://pintia.cn/problem-sets/994805342720868352/problems/994805363914686464 结题思路 思路1:三个for循环,...
浙大pat1002 C++代码
PAT历年真题参考代码PAT历年真题参考代码PAT历年真题参考代码
为PAT考试作宣传用,希望广大的师生们,积极踊跃的参加
1.1 2.5 1.7 1.2 3.1 1.6 4.1 1.2 1.1
PAT甲级优秀辅导资料
我的PAT乙级练习题1001代码记录,题目地址:https://www.patest.cn/contests/pat-b-practise/1001
PAT甲级题目目录,按照一定规律分类,题目从新到旧1112 Stucked Keyboard (20 分)【将键盘坏损的地方修复】 1108 Finding Average (20 分)【读入有效的数字并处理输出无效的数字】 1100 Mars Numbers (20 ...
patb工程文件的说明文档,对patb工程文件的说明。adj、image、ori、cont。
浙大 机试 PAT 参考书 C++ /C语言编写
PAT题解
photosh素材pat文件,
DSM_DS3622xs+_42951.pat
pat.zju.edu.cn上面的大部分代码,基本上都是我自己写的,不过初期的...PAT (Advanced Level) Practise题组基本80个全了 PAT (Basic Level) Practise (中文)20个全了 《数据结构学习与实验指导》实验项目集也做了20个
PAT乙级题解.pdf
Pat试题答案,题号从1001到1049,有需要的同学可以用来参考
1009. 说反话 (20) 给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出。 输入格式:测试输入包含一个测试用例,在一行内给出总长度不超过80的字符串。...输出样例:Come I Here World Hello