第5次异常上机作业
2019-05-08 15:34 飘转至原点 阅读(178) 评论(0) 编辑 收藏 举报package Hhhhh; import java.util.Scanner; public class lll { public static void main(String[] args){ try{ int a,b; Scanner sc=new Scanner(System.in); a=sc.nextInt(); b=sc.nextInt(); System.out.println((a/b)); }catch(Exception e){ //e.printStackTrace(); System.out.println("分母为零不可除"); } finally{ System.out.println("OK"); } } }
package Hhhhh;
import java.util.*;
public class lrrr {
public static void main(String[] args){
try{
double r,s;
final double PI=3.14;
Scanner sc=new Scanner(System.in);
r=sc.nextDouble();
s=r*PI*r;
System.out.println(s);
}catch(Exception e){
System.out.println("输入类型错误");
}
}
}