摘要: Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, 阅读全文
posted @ 2020-03-13 12:05 PennyXia 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 设计函数分别求两个一元多项式的乘积与和。 输入格式: 输入分2行,每行分别先给出多项式非零项的个数,再以指数递降方式输入一个多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。 输出格式: 输出分2行,分别以指数递降方式输出乘积多项式以及和多项式非零项的系数和指数。数字间以空 阅读全文
posted @ 2020-03-13 09:25 PennyXia 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 本题要求实现一个函数,将两个链表表示的递增整数序列合并为一个非递减的整数序列。 函数接口定义: List Merge( List L1, List L2 ); 其中List结构定义如下: typedef struct Node *PtrToNode; struct Node { ElementTyp 阅读全文
posted @ 2020-03-13 09:22 PennyXia 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 void swap(int a,int b){ 3 int temp=a; 4 a=b; 5 b=temp; 6 } 7 int main(){ 8 int a=1,b=2; 9 swap(a,b); 10 printf("%d %d",a,b); 11 阅读全文
posted @ 2020-02-22 17:40 PennyXia 阅读(1242) 评论(1) 推荐(0) 编辑
摘要: 使用pip安装包的时候下载速度经常很慢, 而且时间太久, 最后可能还会报一大串红色错误,导致下载失败,如下图。 解决: 挂vpn开全局代理,秒下。 另外可以找国内资源下载,网上也有不少教程。 阅读全文
posted @ 2020-02-21 19:59 PennyXia 阅读(793) 评论(0) 推荐(0) 编辑
摘要: To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mat 阅读全文
posted @ 2020-02-13 16:55 PennyXia 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。” 现给出一批考生的德才分数,请根据司马光的理论给出录取排名。 输入格式: 输入第一行给出 3 个正整数,分别 阅读全文
posted @ 2020-02-13 16:49 PennyXia 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output Fu first if it is negative. For exampl 阅读全文
posted @ 2020-02-13 16:47 PennyXia 阅读(173) 评论(0) 推荐(0) 编辑
摘要: The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the s 阅读全文
posted @ 2020-02-11 18:34 PennyXia 阅读(163) 评论(0) 推荐(0) 编辑
摘要: To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords 阅读全文
posted @ 2020-02-11 18:25 PennyXia 阅读(132) 评论(0) 推荐(0) 编辑