摘要:
找规律的题目。 题目: 分析: 举例(1,2,3,4)有4个元素,下面是所有可能片段。 情况一,(1),(1,2),(1,2,3),(1,2,3,4),所有片段共有4个1,所以是 4 x 1 x 1 情况二,(2),(2,3),(2,3,4),情况一、二各有3个2,所以是 3 x 2 x 2 情况三 阅读全文
摘要:
水题。还是一道hash题。 #include<iostream> using namespace std; int main() { int map[128] = {0}; char c; while (scanf("%c",&c) != EOF) map[c]++; while (map['P'] 阅读全文
摘要:
水题。发现PAT考察hash很多。 #include<iostream> #include<unordered_map> using namespace std; struct Student { string id;//学号 int sitNum;//考试座位号 }; int main() { i 阅读全文