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
extendd11
Simple imitation for show banners on priorities
PE #10
Ip address
Happy Numbers in Java
클래스의 정의와 인스턴스 생성
Word Destructor
4.d
Fireball Plugin
2B