原创 PAT甲級練習題A1018. Public Bike Management (30)

題目描述 There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over

原创 PAT甲級練習題A1024. Palindromic Number (25)

題目描述 A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For

原创 PAT甲級練習題A1038. Recover the Smallest Number (30)

題目描述 Given a collection of number segments, you are supposed to recover the smallest number from them. For example,

原创 PAT甲級練習題A1017. Queueing at Bank (25)

題目描述 Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides th

原创 PAT甲級練習題A1023. Have Fun with Numbers (20)

題目描述 Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no dupli

原创 PAT甲級A1013. Battle Over Cities (25)

題目描述 It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the en

原创 PAT甲級練習題A1020. Tree Traversals (25)

題目描述 Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder tra

原创 鏈表

鏈表的本質就是一個個串聯的節點,由一個虛擬零節點和其他節點組成,末尾的節點指向空或者是零節點。 鏈表的節點i由三個部分組成: 1. 節點地址loca; 2. 節點的值val; 3. 下一個節點的地址next; 所以並不需要

原创 PAT甲級練習題A1002. A+B for Polynomials

題目描述 This time, you are supposed to find A+B where A and B are two polynomials. Input Each input file contains one

原创 PAT甲級A1014. Waiting in Line (30)

題目描述 Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides th

原创 PAT甲級練習題A1003. Emergency

題目描述 As an emergency rescue team leader of a city, you are given a special map of your country. The map shows sever

原创 PAT甲級練習題A1004. Counting Leaves

題目描述 A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have

原创 PAT甲級練習題A1025. PAT Ranking (25)

題目描述 Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang Univ

原创 PAT甲級A1012. The Best Rank (25)

題目描述 To evaluate the performance of our first year CS majored students, we consider their grades of three courses o

原创 PAT甲級練習題A1016. Phone Bills (25)

題目描述 A long-distance telephone company charges its customers by the following rules: Making a long-distance call co