import java.util.Scanner;
public class EcmDef {
public static void main(String[] args) {
try{
Scanner cin=new Scanner(System.in);
int i,j;
i=cin.nextInt();
j=cin.nextInt();
EcmDef.ecm(i,j);
}catch (NumberFormatException e){
System.out.println("异常:输入数据类型不一致!");
}catch (ArrayIndexOutOfBoundsException e){
System.out.println("异常:缺少命令行参数");
}catch (ArithmeticException e){
System.out.println("异常:分母为0了");
}catch (EcDef e){
System.out.println(e.getMessage());
}
}
public static void ecm(int i,int j) throws EcDef{ //综合应用throw()和throws()!
if(i<0||j<0)
throw new EcDef("您输入的数值存在负数!");
else
System.out.println(i/j);
}
}
class EcDef extends Exception{ //自定义一个异常类, 两个构造器直接 生成即可!
public EcDef() {
}
public EcDef(String message) {
super(message);
}
}