摘要:
/*java.lang包中的Math类提供有常量 * 并包含有用于执行基本数学运算的 * 方法,如初等指数、对数、平方根 * 用于进行更高级的数学运算。由于 * 在Math类的方法都是静态的,因此可 * 直接通过类来调用 * Math.cos(angle); * (使用静态导入(static import)的语言特性"import static java.lang.Math.*" * 就不必在每一个数学函数前面都写Math了。这允许通过简单的 * 名称调用Math类中的方法,例如:“cos(sngle)”! * */public class hello { public s 阅读全文
posted @ 2011-07-08 20:51
又是一年夏天
阅读(708)
评论(0)
推荐(0)
摘要:
import java.text.*;public class hello { //自定义方法,根据参数传入的匹配模式,来格式化数字 public static void cuntomFormat(String pattern,double value) { DecimalFormat myFormatter=new DecimalFormat(pattern); //创建模式对象 String output=myFormatter.format(value); System.out.println(value+" "+pattern+" "+outpu 阅读全文
posted @ 2011-07-08 20:11
又是一年夏天
阅读(318)
评论(0)
推荐(0)
摘要:
import java.util.Calendar;import java.util.Locale;public class hello { public static void main(String[] args) { long n= 382112; System.out.format("%d%n",n); System.out.format("%08d%n", n); System.out.format("%+8d%n", n); System.out.format("%,8d%n", n); System. 阅读全文
posted @ 2011-07-08 19:50
又是一年夏天
阅读(357)
评论(0)
推荐(0)
摘要:
记录下来,以后找方便点#include<stdio.h>#include<stdlib.h>#include<time.h>#define N 100void QKSort(int r[],int low,int high)/*对记录数组r[low..high]用快速排序算法进行排序*/{ int pos; if(low<high) { pos=QKPass(r,low,high); QKSort(r,low,pos-1);//对左部子表进行排序 QKSort(r,pos+1,high);//对右部子表进行排序 }}//一趟快速排序算法int QKPa 阅读全文
posted @ 2011-07-08 19:08
又是一年夏天
阅读(197)
评论(0)
推荐(0)

浙公网安备 33010602011771号