比较难理解的 都打了备注了 1 #include "stdio.h" 2 #include "stdlib.h" 3 #include "string.h" 4 char alphabet[]={'A','B','C','D'}; 5 typedef struct 6 { 7 ...
分类:
编程语言 时间:
2015-04-29 00:18:26
阅读次数:
235
1 public class TestEnum { 2 public enum MyColor{ red , blue ,green }; 3 4 public static void main (String[] args){ 5 MyColor m =...
分类:
编程语言 时间:
2015-04-29 00:15:56
阅读次数:
263
今天解决了5、6个缺陷,发现简单的事情要做好也不简单,正如此才需要人来努力做好。今天发现犯了一个错误,string的indexOf函数,返回值>=0是找到,否则-1是没找到,因为之前的不小心隐藏了这个bug。后续要在工作中提高,要做好下面五多:1.多看,源码实现的原理,特别是一些开源社区贡献的源码、...
分类:
其他好文 时间:
2015-04-29 00:14:13
阅读次数:
122
import java.util.*;import java.io.*;public class Main{ static int [] dp = new int [1010]; public static void main(String [] args)throws IOException{ ....
分类:
编程语言 时间:
2015-04-29 00:11:16
阅读次数:
170
/*汉诺塔:A座有n个盘子,下面直径比上面大,要借助C座,将n个盘子移到B上,移动过程中大盘子一定在小盘子下面*/
package pack;public class Main { static int n = 10;
public static void main(String[] args) {
han(n,'A','B','C'); //将n个盘子借助C,...
分类:
其他好文 时间:
2015-04-28 23:00:32
阅读次数:
193
其实我认为搜索==暴力,只不过搜索是用比较特殊的方式来实现,所以听起来高大上一点,本质上和暴力是一个意思
不知道写这样闪瞎狗眼的代码会不会被人打~
#include
#include
#include
using namespace std;
int rem[30];
int main()
{
int target;
string ans;
while(cin>>target>>ans&...
分类:
其他好文 时间:
2015-04-28 22:58:43
阅读次数:
160
给出6*6的矩阵,起点,终点,一共三堵墙,墙不会相交。
求起点到终点的最少步,保证有解
对每次移动判断相对应的是否有墙即可
#include "stdio.h"
#include "string.h"
#include "queue"
using namespace std;
const int dir[4][2]={ {1,0},{-1,0},{0,1},{0,-1} };
in...
分类:
其他好文 时间:
2015-04-28 22:52:43
阅读次数:
231
1 import java.io.*; 2 3 public class FileList { 4 public static void main (String[] args){ 5 File f = new File("d:/A"); 6 System...
分类:
编程语言 时间:
2015-04-28 22:44:12
阅读次数:
264
原文网址:http://blog.csdn.net/caijunjun1006/article/details/11740223Java中byte用二进制表示占用8位,而我们知道16进制的每个字符需要用4位二进制位来表示(23 + 22 + 21 + 20 = 15),所以我们就可以把每个byte转...
分类:
编程语言 时间:
2015-04-28 22:38:11
阅读次数:
155
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1020自己的代码:#include#includeusing namespace std;int T;string s;int main(){ cin>>T; while(T--) { ...
分类:
其他好文 时间:
2015-04-28 22:23:05
阅读次数:
153