Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
calc exp ne
//calc exp import java.util.Calendar; class Rextester { public static void main(String args[]) { calc( have, need ); } public static void calc(int have, int need){ Calendar now = Calendar.getInstance(); int gio, phut, gioNow, phutNow, gioDone, phutDone; gio = need/ have / 12 / 60; phut = (need/ have / 12) % 60; gioNow = now.get(Calendar.HOUR_OF_DAY) % 12 ; phutNow = now.get(Calendar.MINUTE); if(gioNow < 7) gioNow = gioNow + 5; else gioNow = gioNow - 7; gioDone = (gioNow + gio) % 12; phutDone = phutNow + phut; if(phutDone >=60){ gioDone++; if(gioDone > 12) gioDone = gioDone % 12; phutDone = phutDone - 60; } System.out.println("Cần: " + gio + " giờ, " + phut + " phút"); System.out.println("Xong: " + gioDone + " giờ, " + phutDone + " phút"); if(gio >= 10){ float tenHourExp = have * 12 * 60 * 10; float phanTram = (tenHourExp / need) * 100; gioDone = (gioNow + 10) % 12; System.out.println("\nSau 10 tiếng: " + gioDone + " giờ, " + phutNow + " phút"); System.out.println("Được: " + (int)phanTram + '%' + '(' + (int)tenHourExp + '/' + need + ')'); } } }
run
|
edit
|
history
|
help
0
Copy an array elments into another array
Coloring map
BinaryTreeFindNext_noParentPointer
javaClassAr
multiplo de 4 y 6
Nick-test
Binary Tree ZigZag Traversal
Vasanth Selvaraj
extends
vsecodertest2