|
[讨论]C语言变态乱码
更多可查阅 - 国际C语言混乱代码大赛 IOCCC |
|
一道算法题,求解。
[QUOTE=WitBoy;1171752]网上找了很久 http://bbs.csdn.net/topics/320116107[/QUOTE] 顺便附上 相关的 两篇英文论文 A Simple In-Place Algorithm for In-Shuffle.pdf In-place permuting and perfect shuffling using involutions.pdf |
|
|
|
一道算法题,求解。
先放个思路,算法复杂度 应该是符合楼主要求的,不过答案正确性就不好说了 当 N 为 2 3 6 7 10 15 19 27 30 31 34 ... 答案是符合要求的 N为其他值时的 错误原因已经找到,解决方法尚在思考。 #include <stdio.h> #define N (10) void Show(int *pnAry, int n); void Change(int *pnAry, int n); int main() { int nAry[2*N] = {0}; int i = N; while (i--) { nAry[i] = i; nAry[N+i] = i*10 + 1; } Show(nAry, 2*N); Change(nAry, N); Show(nAry, 2*N); return 0; } void Show(int *pnAry, int n) { int i = 0; for(;i<n;i++) { printf("%3d", pnAry[i]); } puts(""); } void Change(int *pnAry, int n) { int i = 1; int nNext, nPrev; nNext = pnAry[1]; while (i != n) { nPrev = nNext; if (i<n) { i = 2*i; } else { i = (i-n+1)*2-1; } nNext = pnAry[i]; pnAry[i] = nPrev; } pnAry[1] = nNext; } |
|
[讨论]大学生程序员的心声
大家知道我的大学(如果大专也算的话)有多操蛋吗? 宿舍里没有插座,仅有的电器是一个灯泡一个开关. 当初还想着上了大学买个笔记本嘞,得,这钱也省了. 大学3年过的跟个行尸走肉似的,还有没几天就拿毕业证了,这个大学上的我得后悔8辈子,这辈子都不想再跟它有牵连. 校名HX,地区QD. |
|
|
|
|
|
[求助]请问怎么提高自己的Kx
赚取Kx的方法:1.论坛小测试(赚取30Kx) 2.在线时间获取虚拟币:在线1小时(要经常刷新浏览)奖励1Kx,每天晚上24点兑现,每天5Kx封顶。3.『求助问答区』答疑快速获得Kx。 新人吧,先看看论坛版规请点击这里。 |
|
|
|
[下载]论坛网页自动刷新
技术至上,其他神马都是浮云,祝你我大家早日跨入牛人的行列。 |
|
[下载]论坛网页自动刷新
如果只是为刷论坛而去下个360浏览器的话,觉得有点犯不着吧。况且360的流氓是众所皆知的说。我是从来不用360的任何产品。 当然,这倒是提醒了已经安装了类似可以自动刷新的浏览器的同学。 |
|
[下载]论坛网页自动刷新
我只是想能早点升级为正式会员,免去下载附件扣Kx的限制,我一天工作十来个小时,没多少时间看帖发帖的,只好先这么挂着。 |
|
[求助]内存卡无法格式化。在电脑上提示windows无法完成格式化
试试用“魅色U盘精灵”进行分区和格式化。 |
|
[下载]论坛网页自动刷新
我不知道115的挂机规则,如果仅仅是不停刷新网页就行的话,手动输入把网址换一下就可以。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值