-
Notifications
You must be signed in to change notification settings - Fork 2
/
save.txt
21 lines (19 loc) · 860 Bytes
/
save.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
private static String chuanHoaTen(String s){
s = s.trim().toLowerCase();
String res = "" + Character.toUpperCase(s.charAt(0));
for(int i=1; i< s.length();i++){
if(Character.isLetter(s.charAt(i))){
if(s.charAt(i-1) == ' ') res+= " "+ Character.toUpperCase(s.charAt(i));
else res += s.charAt(i);
}
}
return res;
}
static long getDay(String dayIn,String dayOut){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date dateIn = simpleDateFormat.parse(dayIn);
Date dateOut = simpleDateFormat.parse(dayOut);
return (dateOut.getTime() - dateIn.getTime()) /(24 * 60 * 60 * 1000) + 1;
return 0;
}
new SimpleDateFormat("dd/MM/yyyy").parse(sc.next());