摘要: /** * 把一个字符串数字转换成整型,禁止使用Integer.valueOf(i)方法 * @author alen * */ public class ChangeStr { public static int Convert(String str) throws Exception { int a = 0,i = 0; char[] cStr = str.toCharArray(); //判断是否是负数 if (cStr.length > 0 && cStr... 阅读全文
posted @ 2011-06-26 00:49 petercao 阅读(2104) 评论(0) 推荐(0) 编辑
摘要: /** * 把字符串中所有小写字母转换成大写,其余不变,不能用Stirng.toUpperCase()方法 * @author alen * */ public class Change { public static String changeStr(String str){ str.toUppe 阅读全文
posted @ 2011-06-26 00:37 petercao 阅读(2028) 评论(0) 推荐(0) 编辑
摘要: 用一句话概括,都是用来存储命令行参数的。下面看例子:#include <stdio.h>/**argc表示命令行参数的个数。C/C++规定,*程序本身的文件名也算一个命令行参数,因此argc的值至少为1;*argv是一个字符指针型的数组,用来存储命令行参数。*如:argv[0]指向的字符串就是第一个命令行参数..........*/int main(int argc, char *argv[]){ for(int i=0; i<argc; i++){ printf("%s/n", argv[i]); } int a; scanf("%d" 阅读全文
posted @ 2011-06-26 00:16 petercao 阅读(2891) 评论(0) 推荐(0) 编辑