2014年10月30日
摘要:
原理:直方图均衡化首先是一种灰度级变换的方法:原来的灰度范围[r0,rk]变换到[s0,sk]变换函数为:s=T(r);为便于实现,可以用查找表(look-up table)的方式存储,即:原始的灰度作为查找表的索引,表中的内容是新的灰度值。其次,直方图均衡化是图像增强的一种基本方法,可提高图像的对...
阅读全文
posted @ 2014-10-30 20:04
Sweet Smile
阅读(25709)
推荐(1)
2014年3月21日
摘要:
package randomWalk;import java.util.Random;import java.util.Scanner;public class RandomWalk { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.print("intput the steps you want to walk:"); int steps =console.nex...
阅读全文
posted @ 2014-03-21 13:06
Sweet Smile
阅读(1074)
推荐(0)
摘要:
//(单词的第一个元音字母之前的一道单词后面,以"ay"结尾,英语单词首字母为元音字母或者没有元音字母的以“ay”为后缀。)package toPigLatin;import java.util.Scanner;public class ToPigLatin { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.print("enter an line: "); String s = console.nextL...
阅读全文
posted @ 2014-03-21 12:57
Sweet Smile
阅读(356)
推荐(0)
摘要:
1)计算机产生一1~100的随机数,用户猜测,会有提示是较大还是较小。用户可以多玩几次(需要输入玩的次数),退出时打印他猜测的总次数及猜中一个数字的平均次数。package userGuessInteger2;import java.util.Random;import java.util.Scanner;public class userGuessInteger2 { public static void main(String[] args) { Random r = new Random(); Scanner console =...
阅读全文
posted @ 2014-03-21 12:47
Sweet Smile
阅读(1561)
推荐(0)
2014年3月20日
摘要:
package hexConversion;import java.util.Scanner;public class HexConversion { public static final int HEX = 2; public static void main(String[] args) { System.out.print("input an integer: "); Scanner console = new Scanner(System.in); int number = console.nextInt(); ...
阅读全文
posted @ 2014-03-20 13:59
Sweet Smile
阅读(226)
推荐(0)
摘要:
package showTwos;import java.util.Scanner;public class ShowTwos {//用户输入一整数,将其进行质因数分解,并打印分解结果。 public static void main(String[] args) { System.out.print("input an integer: "); Scanner console = new Scanner(System.in); int number = console.nextInt(); System.out.p...
阅读全文
posted @ 2014-03-20 09:24
Sweet Smile
阅读(682)
推荐(0)
2014年3月15日
摘要:
package checkTheID;import java.util.Scanner;public class CheckTheID { //学号6位数字,校验位第7位。也可以修改。 //用户输入学号及校验位,程序检测用户输入的学号是否正确。 //校验位=(1*(第1位数字)+2*(第2位数字)+3*(第3位数字) //+4*(第4位数字)+5*(第5位数字)+6*(第6位数字))%10 public static final int IDLENGTH = 7; public static void main(String[] args) { ...
阅读全文
posted @ 2014-03-15 14:09
Sweet Smile
阅读(687)
推荐(0)
摘要:
//用户输入打印的杨辉三角的行数line,输出:打印杨辉三角(每个数字的宽度是4.)package printPascalTriangle2;import java.util.Scanner;public class PrintPascalTriangle2 { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.print("input the lines > 1:"); int lin...
阅读全文
posted @ 2014-03-15 09:44
Sweet Smile
阅读(745)
推荐(0)
2014年3月14日
摘要:
package judgeWeekday;import java.util.Scanner;public class JudgeWeekday { //参考点选择2014年1月1日星期三具有一定的特殊性;代码也与之有关。 public static final int YEAR0 = 2014; //public static final int MONTH0 = 1; //public static final int DAY0 = 1; public static final int WEEKDAY0 = 3; public static final ...
阅读全文
posted @ 2014-03-14 19:09
Sweet Smile
阅读(2142)
推荐(0)
2014年2月28日
摘要:
1)C++默认为内部链接;C默认为外部链接2)在C++中,一般一个const不会创建内存空间,而是将其保存在符号表(待看)。比如: const int bufsize = 100; char buf[bufsize]; 这里无需为const创建内存空间,进行完类型检查之后,值会折叠到代码中。 但也有为const分配内存的时候。如取一个const的地址或者把它定义为extern等。#include const int i = 100; const int j = i + 10; long address = (long)&j;//i、j本没有被分配存储空间,但因为这里需要j的地址,故迫使
阅读全文
posted @ 2014-02-28 20:25
Sweet Smile
阅读(553)
推荐(0)