2015年4月30日
摘要: http://www.patest.cn/contests/pat-a-practise/1092Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy ... 阅读全文
posted @ 2015-04-30 10:12 Asin_LZM 阅读(181) 评论(0) 推荐(0) 编辑
摘要: http://www.patest.cn/contests/pat-a-practise/1093The stringAPPAPTcontains twoPAT's as substrings. The first one is formed by the 2nd, the 4th, and the... 阅读全文
posted @ 2015-04-30 10:08 Asin_LZM 阅读(250) 评论(0) 推荐(0) 编辑
摘要: http://www.patest.cn/contests/pat-a-practise/1094A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belo... 阅读全文
posted @ 2015-04-30 10:04 Asin_LZM 阅读(283) 评论(0) 推荐(0) 编辑
摘要: http://www.patest.cn/contests/pat-a-practise/1095Zhejiang University has 6 campuses and a lot of gates. From each gate we can collect the in/out times... 阅读全文
posted @ 2015-04-30 09:23 Asin_LZM 阅读(356) 评论(0) 推荐(0) 编辑
  2015年4月28日
摘要: http://www.patest.cn/contests/pat-b-practise/1006让我们用字母B来表示“百”、字母S表示“十”,用“12...n”来表示个位数字n( 2 #include 3 int main() 4 { 5 int num=0; 6 scanf(... 阅读全文
posted @ 2015-04-28 18:51 Asin_LZM 阅读(162) 评论(0) 推荐(0) 编辑
摘要: http://www.patest.cn/contests/pat-b-practise/1005卡拉兹(Callatz)猜想已经在1001中给出了描述。在这个题目里,情况稍微有些复杂。当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数。例如对n=3进行验证的时候,我们... 阅读全文
posted @ 2015-04-28 18:50 Asin_LZM 阅读(186) 评论(0) 推荐(0) 编辑
摘要: http://www.patest.cn/contests/pat-b-practise/1004读入n名学生的姓名、学号、成绩,分别输出成绩最高和成绩最低学生的姓名和学号。输入格式:每个测试输入包含1个测试用例,格式为 第1行:正整数n 第2行:第1个学生的姓名 学号 成绩 第3行:第2个学... 阅读全文
posted @ 2015-04-28 18:48 Asin_LZM 阅读(250) 评论(0) 推荐(0) 编辑
摘要: http://www.patest.cn/contests/pat-b-practise/1003“答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于PAT的“答案正确”大派送 —— 只要读入的字符串满足下列条件,系统就输出“答案正确”,否则输出“答案错误”。得到“答案正确”的条件是:1. 字... 阅读全文
posted @ 2015-04-28 18:47 Asin_LZM 阅读(187) 评论(0) 推荐(0) 编辑
摘要: http://www.patest.cn/contests/pat-b-practise/1002读入一个自然数n,计算其各位数字之和,用汉语拼音写出和的每一位数字。输入格式:每个测试输入包含1个测试用例,即给出自然数n的值。这里保证n小于10100。输出格式:在一行内输出n的各位数字之和的每一位,... 阅读全文
posted @ 2015-04-28 18:46 Asin_LZM 阅读(214) 评论(0) 推荐(0) 编辑
摘要: http://www.patest.cn/contests/pat-b-practise/1001卡拉兹(Callatz)猜想:对任何一个自然数n,如果它是偶数,那么把它砍掉一半;如果它是奇数,那么把(3n+1)砍掉一半。这样一直反复砍下去,最后一定在某一步得到n=1。卡拉兹在1950年的世界数学家... 阅读全文
posted @ 2015-04-28 18:45 Asin_LZM 阅读(161) 评论(0) 推荐(0) 编辑