摘要: 求解特定数字的个数问题<b <i 求解从1到n的所有数中,特定数字m(0 <= m <= 9)的个数问题</i </b <i uint64_t countN(uint64_t x, uint64_t n) { uint64_t lowernum; uint64_t currentnum; u... 阅读全文
posted @ 2015-08-05 14:08 WONDERFUL_cnblogs 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 最大公约数与最小公倍数问题<b <i 最大公约数</i </b <i uint64_t gcd(uint64_t x, uint64_t y) { uint64_t ret = 1; if (x == y) { return y; } while (true) { if (x < y) { ... 阅读全文
posted @ 2015-08-04 11:01 WONDERFUL_cnblogs 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 寻找“发帖”水王<b <i 在一个数组中,有n个数,在数组中出现的次数"大于" "1/(n+1)"</i </b <i int findN(int pIn, int iInLen, int n, int pOut) { memset(pOut, 0, n sizeof(int)); int... 阅读全文
posted @ 2015-08-03 17:10 WONDERFUL_cnblogs 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 单链表操作 <b <i 链表节点定义:</i </b <i struct node { int value; struct node next; };</i <i 反转单链表</i <i struct node reverse(struct node list) { if (NU... 阅读全文
posted @ 2015-07-29 15:02 WONDERFUL_cnblogs 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 实现原理:1.顶层窗体设置为无边框,背景半透明2.顶层窗体的子窗体使用带有阴影的图片做背景代码://CMainWindow.h#ifndef CMAINWINDOW_H#define CMAINWINDOW_H#include class CMainWindow : public QWidget{ ... 阅读全文
posted @ 2014-08-19 13:38 WONDERFUL_cnblogs 阅读(1525) 评论(0) 推荐(0) 编辑