// 根据出生日期计算年龄周岁 传参格式为1996-06-08 // 根据出生日期计算年龄周岁 传参格式为1996-06-08 function getAge(strBirthday) { var returnAge = ''; var mouthAge = ''; var strBirthdayArr = strBirthday.split("-"); var birthYear = strBirthdayArr[0]; var birthMonth = strBirthdayArr
import java.util.Scanner; public class test{ public static void main(String args[]){ Rational a=new Rational(4,5); Rational b=new Rational(3,2); Rational c=a.chu(b); c.show(); } } class Rational{ int fenzi=1; int fenmu=1; int f(int a,int b){//公约数 if(
import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; /** * Created by qing on 2017/3/28. */ public class AgeUtils { // 根据年月日计算年龄,birthTimeString:"1994-11-14" public static int getAgeFromBirthTime(String birthTimeS
写一个小程序,用来计算它包含的代码所需的耗时.虽然简单,测试代码是否耗时还是有点用的,不用重新写嘛~ import java.util.Date; import java.util.concurrent.TimeUnit; public class TimeLag { private Date start; private Date end; public TimeLag() { start = new Date(); } public String cost() { end = new Dat
编写了一个遍历一个目录下所有的文件及文件夹,然后计算每个文件的字符和line的小程序,先把程序贴出来. #coding=utf-8 ''' Created on 2014年7月14日 @author: Administrator ''' import os import os.path rootdir =r'c:\python27\jiaoben' filefullnames=[] def traverse(rootdir,filefullnames): for parent,dirnames,