PAT (Advanced Level) Practise
文章平均质量分 67
MAKEMEFATTER
这个作者很懒,什么都没留下…
展开
-
1001. A+B Format (20)
Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).InputEach input file cont原创 2014-07-20 20:48:41 · 377 阅读 · 0 评论 -
1008. 数组元素循环右移问题 (20)
一个数组A中存有N(N>0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(M>=0)个位置,即将A中的数据由(A0A1……AN-1)变换为(AN-M …… AN-1 A0 A1……AN-M-1)(最后M个数循环移至最前面的M个位置)。如果需要考虑程序移动数据的次数尽量少,要如何设计移动的方法?输入格式:每个输入包含一个测试用例,第1行输入N ( 1=0);第2行输入N个整数原创 2014-07-23 10:17:32 · 538 阅读 · 0 评论