1、多发核心期刊论文
2、发的论文顺路能得技术创新奖
3、得技术创新奖能发大把的奖金
4、用奖金买股票能够一路涨停
5、不在博客里吹牛
总有一个要实现!
相关文章
- #include <> typedef struct Node { int index; struct Node *next; }JosephuNode; int Josephu(int n, int m) { int i, j; JosephuNode *head, *tail; head = tail = (JosephuNode *)malloc(sizeof(JosephuNode)); for (i = 1; i < n; ++i) { tail->index = i; tail->next = (JosephuNode *)malloc(sizeof(JosephuNode)); tail = tail->next; } tail->index = i; tail->next = head; for (i = 1; tail != head; ++i) { for (j = 1; j < m; ++j) { tail = head; head = head->next; } tail->next = head->next; printf("第%4d个出局的人是:%4d号\n", i, head->index); free(head); head = tail->next; } i = head->index; free(head); return i; } int main { int n, m; scanf("%d%d", &n, &m); printf("最后胜利的是%d号!\n", Josephu(n, m)); system("pause"); return 0; }">设编号为1,2,… n的n个人围坐一圈,约定编号为k(1数组实现: #include <> #include <> int Josephu(int n, int m) { int flag, i, j = 0; int *arr = (int *)malloc(n * sizeof(int)); for (i = 0; i < n; ++i) arr[i] = 1; for (i = 1; i < n; ++i) { flag = 0; while (flag < m) { if (j == n) j = 0; if (arr[j]) ++flag; ++j; } arr[j - 1] = 0; printf("第%4d个出局的人是:%4d号\n", i, j); } free(arr); return j; } int main { int n, m; scanf("%d%d", &n, &m); printf("最后胜利的是%d号!\n", Josephu(n, m)); system("pause"); return 0; } 链表实现: #include <> #include <> typedef struct Node { int index; struct Node *next; }JosephuNode; int Josephu(int n, int m) { int i, j; JosephuNode *head, *tail; head = tail = (JosephuNode *)malloc(sizeof(JosephuNode)); for (i = 1; i < n; ++i) { tail->index = i; tail->next = (JosephuNode *)malloc(sizeof(JosephuNode)); tail = tail->next; } tail->index = i; tail->next = head; for (i = 1; tail != head; ++i) { for (j = 1; j < m; ++j) { tail = head; head = head->next; } tail->next = head->next; printf("第%4d个出局的人是:%4d号\n", i, head->index); free(head); head = tail->next; } i = head->index; free(head); return i; } int main { int n, m; scanf("%d%d", &n, &m); printf("最后胜利的是%d号!\n", Josephu(n, m)); system("pause"); return 0; }
- 移动硬盘插上电脑卡住_插入移动硬盘死机故障分析及解决方案(图文详解)
- 解决戴尔笔记本电脑插上耳机没反应,要重启才能识别
- 解决电脑插上U盘能检测到,但是u盘不显示,,USB 大容量设备 感叹号 代码10,可能是被其他软件禁用了,改了注册表信息
- 海康设备插上移动硬盘,空间为0的解决办法
- 【Python】AttributeError: module lib has no attribute X509_V_FLAG_CB_ISSUER_CHECK
- java踩坑 if(!flag){}和 if(flag==false){}
- flag计算机语言的意思,flag是什么意思-c语言flag的用法
- C语言中的flag
- 单片机c语言中flag用法,单片机中定义flag有啥作用flag=1和flag=0都是什么意思