04 2018 档案

摘要:欧几里得算法的原理:基于这样一种观察,两个整数x和y(x>y)的最大公约数等同于y和(x%y)的最大公约数; 数t整除x和y,当且仅当t整数y和(x%y);这是因为:x = t*y + x%y; 具体代码如下: 阅读全文
posted @ 2018-04-27 11:49 朝雾之归乡 阅读(912) 评论(0) 推荐(0) 编辑
摘要:#include #include using namespace std; typedef struct node* list; struct node { int Item; list next; }; void Display(list head) { list t = head; while (nullptr != t) { ... 阅读全文
posted @ 2018-04-26 14:36 朝雾之归乡 阅读(299) 评论(0) 推荐(0) 编辑
摘要:#include #include using namespace std; typedef struct node* list; struct node { int Item; list next; }; static void DisplayList(list head) { if (head->next == nullptr) { ... 阅读全文
posted @ 2018-04-25 09:53 朝雾之归乡 阅读(362) 评论(0) 推荐(0) 编辑
摘要:#include #include int main(int argc, char *argv[]) { int i = 2, j = 0; long N = atol(argv[1]); int *a = malloc(N*sizeof(int)); if (NULL == a) { printf("There is no enough... 阅读全文
posted @ 2018-04-21 13:26 朝雾之归乡 阅读(365) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示