PAT
Easadon
The one who can beat me is only me.
展开
-
L1-002. 打印沙漏
本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印***** *** * *** ***** 所谓“沙漏形状”,是指每行输出奇数个符号;各行符号中心对齐;相邻两行符号数差2;符号数先从大到小顺序递减到1,再从小到大顺序递增;首尾符号数相等。给定任意N个符号,不一定能正好组成一个沙漏。要求打印出的沙漏能用掉尽可能多的符号。输入格式:输入在一行给出1个正整...原创 2018-03-08 22:11:26 · 139 阅读 · 0 评论 -
A+B in Hogwarts (20)
If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Si...原创 2018-04-14 15:31:26 · 135 阅读 · 0 评论 -
Prime Factors (25)
Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1^k1* p2^k2 *…*pm^km.Input Specification:Each input file contains one test case which...原创 2018-04-14 18:33:28 · 290 阅读 · 2 评论 -
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 contains one...原创 2018-04-14 10:50:03 · 136 阅读 · 0 评论