Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
贴代码javaimport java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int count = 0; while(true){ count ++; int p= in.nextInt(); int e= in.nextInt(); int i= in.nextInt(); int d= in.nextInt(); if(p==-1 && e==-1 && i==-1 && d==-1) break; int num = (5544*p+14421*e+1288*i-d+21252)%21252; if(num==0){ num = 21252; } System.out.println("Case "+count+": the next triple peak occurs in "+num+" days."); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator