Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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; phutDone = phutNow + phut; if(phutDone >=60){ gioDone++; phutDone = phutDone - 60; } System.out.println("Cần: " + gio + " giờ, " + phut + " phút"); System.out.println("Xong: " + gioDone + " giờ, " + phutDone + " phút"); } }
run
|
edit
|
history
|
help
0
Random and count of even numbers (ver. 2)
Day
jb11.0 threads tick tock 1.0
Compare Version Numbers
Fibonacci numbers 0 - 1_000
home by stars
formuły
Split
4c
Pattern1