Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

贴代码java

Posted by 15686354699 at 2015-05-22 20:44:48 on Problem 1006
import 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator