1234567891011121314151617181920212223242526272829303132333435 |
- import java.util.*;
- class Exer04
- {
- public static void main(String[] args)
- {
- /*
- Exer03
- 请输入你的网名、你的年龄、你的体重、你是否单身、你的性别等情况。
- next() . nextInt(). nextDouble(). nextBoolean(). next()
- */
- Scanner sc = new Scanner(System.in);
- System.out.println("网名");
- String name = sc.next();
- System.out.println("网名"+name);
- System.out.println("年龄");
- int age = sc.nextInt();
- System.out.println("年龄"+age);
- System.out.println("体重");
- double weight = sc.nextDouble();
- System.out.println("体重"+weight);
- System.out.println("单身");
- boolean flag = sc.nextBoolean();
- System.out.println("单身"+flag);
- System.out.println("性别");
- char gender = sc.next().charAt(0); //abc charAt(0) a
- System.out.println("性别"+gender);
- }
- }
|