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

错在哪里

Posted by 114830139 at 2012-11-18 19:51:26
import java.util.Scanner;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		double sum=1;
		Scanner m=new Scanner(System.in);
		int a=m.nextInt();
		int b=m.nextInt();
		if(a==0&&b==1){
			System.out.println(b+" "+"divides"+" "+a+"!");
			
		}
		if(a==0&&b!=1){
			  System.out.println(b+" "+"does not divide"+" "+a+"!");
		}
		
		if(b>0&& a>0){
		for(int i=1;i<=a;i++){
			sum=sum*i;
		}
	
        if(sum%b==0){
        	System.out.println(b+" "+"divides"+" "+a+"!");
        }
        else{
        System.out.println(b+" "+"does not divide"+" "+a+"!");
        
	}
	}
}
}

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