- 博客(5)
- 资源 (5)
- 收藏
- 关注
原创 一道C语言面试题——迷宫的回溯算法
#include "stdafx.h"#define MAX_SIZE 8int H[4] = {0, 1, 0, -1}; //水平方向下一位置相对当前位置的距离int V[4] = {-1, 0, 1, 0}; //垂直方向下一位置相对当前位置的距离//迷宫:o-通路,X-障碍(可以不是方阵)char Maze[MAX_SIZE][MAX_SIZE
2005-09-30 16:10:00
2324
原创 一道C语言面试题——求最大连续数字子串
#include "stdafx.h" int GetSubString(char *strSource, char *strResult){ int iTmp=0, iHead=0, iMax=0; for(int Index=0, iLen=0; strSource[Index] != /0; Index++) { // 该字符是数字,前一个字符也是数
2005-09-30 15:49:00
2253
原创 一道C语言面试题——大数相乘的问题
#include "stdafx.h"void Multiple(char A[], char B[], char C[]){ int TMP, In=0, LenA=-1, LenB=-1; while(A[++LenA] != /0); while(B[++LenB] != /0); int Index, Start = LenA + LenB - 1;
2005-09-30 15:47:00
1339
原创 一道C语言面试题——网格中黑点的位置
#include "stdafx.h"#define ROWS 6#define COLS 7int iPointsR[ROWS] = {2, 0, 4, 3, 4, 0}; // 各行点数和的情况int iPointsC[COLS] = {4, 1, 2, 2, 1, 2, 1}; // 各列点数和的情况int iCount, iFound, iSumR[ROW
2005-09-30 15:05:00
1611
原创 一道C语言面试题——邮票组合问题
#include "stdafx.h"#define N 5#define M 5int k, Found, Flag[N];int Stamp[M] = {0, 1, 4, 12, 21};// 在剩余张数n中组合出面值和Valueint Combine(int n, int Value){ if(n >= 0 && Value == 0){ Found = 1
2005-09-30 15:01:00
2540
1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人