import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Random;
import java.util.Scanner;

public class hero{
    String name;
    int hp;
    int pow;
}

public class fight{
    int[] whoFirst = {0,1};
    Random randFirst = new Random();
    int randomIndex=randfirst.nextInt(whoFirst.length);
    int result = whoFirst[randomIndex];

    if(result==0){
    System.out.println("아이언맨의 선공입니다."\n);
    System.out.println("아이언맨의 체력: "+iron.hp\n
                      "아이언맨의 공격력: "+iron.pow\n
                        "저격수의 체력: "+);
    
    }
}

public class start{
    Scanner sc = new Scanner(System.in);
    do{
        System.out.println("싸우려면 '시작'을 입력하세요. > ");
        String ifstart = sc.nextLine();
    } While(! ifstart.equals("시작"));
    sc.close();
}
class Main {
    public static void main(String[] args) {

        Random randpow = new Random();
        int ironpow = random.nextInt(11)+10;
        int sniperpow = random.nextInt(21)+10;
        
        hero iron = new hero();
        iron.name="아이언맨";
        iron.hp=100-sniper.pow;
        iron.pow = ironpow;
        hero sniper = new hero();
        sniper.name="저격수";
        sniper.hp=65-iron.pow;
        sniper.pow = sniperpow;

        start input = new start();
        fight result = new fight();
            
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: