摘要:
杭电1241Sample Input1 1*3 5*@*@***@***@*@*1 8@@****@*5 5****@*@@*@*@**@@@@*@@@**@0 0Sample Output0122View Code 1 //杭电1241 2 3 #include<stdio.h> 4 #include<string.h> 5 #define N 120 6 char map[N][N]; 7 int m,n; 8 int b[8][2]={1,0, -1,0, 0,1, 0,-1, 1,1, -1,1, 1,-1,-1,-1}; 9 10 void bfs(int x 阅读全文
posted @ 2012-07-28 16:02
zlyblog
阅读(111)
评论(0)
推荐(0)
摘要:
杭电1242Sample Input7 8#.#####.#.a#..r.#..#x.....#..#.##...##...#..............Sample Output13View Code 1 //杭电1242 2 #include<stdio.h> 3 #include<queue> 4 using namespace std; 5 #define N 202 6 char map[N][N]; 7 int mark[N][N]; 8 int m,n,x,y,flag; 9 int d[4][2]={1,0,-1,0,0,1,0,-1};10 typed 阅读全文
posted @ 2012-07-28 15:59
zlyblog
阅读(155)
评论(0)
推荐(0)
摘要:
杭电1372Sample Inpute2 e4a1 b2b2 c3a1 h8a1 h7h8 a1b1 c3f6 f6Sample OutputTo get from e2 to e4 takes 2 knight moves.To get from a1 to b2 takes 4 knight moves.To get from b2 to c3 takes 2 knight moves.To get from a1 to h8 takes 6 knight moves.To get from a1 to h7 takes 5 knight moves.To get from h8 to a 阅读全文
posted @ 2012-07-28 15:54
zlyblog
阅读(211)
评论(0)
推荐(0)
摘要:
杭电1042View Code 1 #include<stdio.h> 2 #include<memory.h> 3 int a[10000]; 4 int Mulity(int n) 5 { 6 int carry,i,j,w,g,t; 7 memset(a,0,sizeof(a)); 8 a[0]=1; 9 w=1; //刚开始时只有1位10 for(i=1;i<=n;i++)11 { 12 carry=0;13 t=w;14 //用数字与原有的结果的各位的数字一一相乘,从而分解数字(利于存... 阅读全文
posted @ 2012-07-28 10:50
zlyblog
阅读(220)
评论(0)
推荐(0)

浙公网安备 33010602011771号