- 博客(8)
- 收藏
- 关注
翻译 约瑟夫问题算法
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 342
翻译 仿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 1177
翻译 索引数组冒泡方法
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 358
翻译 正序输出一个正整数
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 744
翻译 插入排序
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 211
原创 折半查找
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 281
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人