![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
技术代码
happy12138
这个作者很懒,什么都没留下…
展开
-
折半查找
int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; // int count = sizeof(a) / sizeof(a[0]); // int left = 0, right = count - 1; // int mid = 0; // int x= 0; // scanf("%d", &x); //原创 2014-07-16 13:29:45 · 277 阅读 · 0 评论 -
正序输出一个正整数
int countOfInt(int n) { if (0 == n) { return 1; } int count = 0; while (n > 0) { n /= 10; count++; } return count; }翻译 2014-07-17 13:38:55 · 737 阅读 · 0 评论 -
插入排序
int array[] = {5, 4, 3, 2, 1, 6}; // int count = sizeof(array) / sizeof(array[0]); // for (int i = 1; i // int j = i; // int temp = array[j]; // while (j > 0翻译 2014-07-17 13:27:28 · 207 阅读 · 0 评论 -
索引数组冒泡方法
int a[] = {3, 5, 6, 1, 2, 4}; int count = sizeof(a) / sizeof(*(a)); int b[count]; for (int i = 0; i *(b + i) = i; } for (int i = 0; i 1; i++) {翻译 2014-07-18 13:11:10 · 353 阅读 · 0 评论 -
仿ATM取款机
#include #include "ATMOperate.h" int cards[5] = {10001, 10002, 10003, 10004, 10005}; int pwd[5] = {111111, 222222, 333333, 444444, 555555}; int money[5] = {10000, 200, 5000, 1000, 600}; int翻译 2014-07-19 13:18:55 · 1171 阅读 · 0 评论 -
约瑟夫问题算法
int a[13] = {0}; int count = 0; int i = 0; int p = 0; while (i 13) { if (0 == a[i]) { count++; } if (3 == count) {翻译 2014-07-21 12:33:58 · 334 阅读 · 0 评论