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);
    		
    
    	}
    
    }
    

      

  • 相关阅读:
    /etc/init.d/functions: No such file or directory报错问题
    在Linux上安装Python3.7.1
    python 使用openpyxl实现读写xlsx文件
    Git 撤销本地修改
    element的el-table表格自定义表头,slot="header"内,数据不更新的问题
    记录下本地修改文件名称大小写问题线上说找不到文件
    解决国内访问github慢的问题笔记
    vue项目中使用echarts实现疫情地图
    uni-app项目搭建
    uniapp引入uni-ui组件报错TypeError: this.getOptions is not a function
  • 原文地址:https://www.cnblogs.com/123456Crazy111/p/10664551.html
Copyright © 2011-2022 走看看