zoukankan      html  css  js  c++  java
  • 第二次作业

    1.Person

    package ddd;
    import java.util.*;
    public class Person {
    
    	public static void main(String[] args) {
    	     Scanner sc = new Scanner(System.in); 
             System.out.println("请输入你的姓名:"); 
             String name = sc.next(); 
             System.out.println("请输入你的性别:"); 
             String sex = sc.next(); 
             System.out.println("请输入你的年龄:");
             int age = sc.nextInt(); 
             sc.nextLine();
             System.out.println("请输入你的身份证号码::");
             String idecart = sc.nextLine();
             System.out.println("你的信息如下:");
             System.out.println("姓名:"+name+"
    "+"性别:"+sex+"
    "+"年龄:"+age+"
    "+"身份证号码:"+idecart);
    		}
    
    }
    

      

    2.Phone

    package ddd;
    import java.util.*;
    public class Phone {
    	public static void main(String[] args) {
    	for(int i=0;i<3;i++) {
    		Scanner sc=new Scanner(System.in);
    	 System.out.println("请输入手机品牌:");
         String Phonebrand=sc.nextLine();
    	 System.out.println("请输入手机型号:");
         String Phonetype=sc.nextLine();
         System.out.println("手机品牌:"+Phonebrand+"手机型号:"+Phonetype);
    
    	}
    	
    	}
        
    }
    

      

    3.book

    package ddd;
    import java.util.*;
    public class book {
    	public static void main(String[] args) {
    	Scanner sc=new Scanner(System.in);
          String name=sc.nextLine();
          String num=sc.nextLine();
          String editor=sc.nextLine();
          String press=sc.nextLine();
          String year=sc.nextLine();
          String month=sc.nextLine();
          String day=sc.nextLine();
          String page=sc.nextLine();
          String price=sc.nextLine();
          System.out.println("书名:"+name+"   "+"书号:"+num+"  "+"编辑:"+editor);
          System.out.println("出版社:"+press+"   "+"时间:"+year+"年"+month+"月"+day+"日");
          System.out.println("页数:"+page+"  "+"价格:"+price);
          
    	}
          
          
    }
    

      

    4.yuan

    package ddd;
    import java.util.*;
    public class YUAN {
    
    	public static void main(String[] args) {
    		Scanner sc=new Scanner(System.in);
    		double r=sc.nextDouble();
    		sc.hasNextLine();
    		double h=sc.nextDouble();
    		sc.hasNextLine();
    		double s,v;
    		final double PAI=3.14;
    		s=r*r*PAI;
    		v=PAI*r*r*h;
    		System.out.println("半径"+r+"高"+h+"底面积:"+s+"体积:"+v);
    		
    
    	}
    
    }
    

      

  • 相关阅读:
    hadoop 环境配置
    批量生成不同尺寸的图片
    如何生成publish windows app 用到的 pfx 文件
    MVC项目用Windsor注入
    UWP textbox 只能输入数字
    power shell upload file to azure storage
    Checkbox can't checked
    安装部署 Goaccess
    阿里云OSS的Bucket容量大小采集
    1. Nagios和 NagiosQL安装及配置
  • 原文地址:https://www.cnblogs.com/123456Crazy111/p/10664551.html
Copyright © 2011-2022 走看看