728x90
SMALL

using System;

public class Hello{

    public static void Main(){

        var data = Console.ReadLine();

        string [] enemies = data.Split(',');

       

        foreach(var str in enemies)

        {

            Console.WriteLine(str + "が現れた!");

           

        }

        var num = enemies.Length;

        Console.WriteLine("敵は" + num + "");

        var random = new Random();

        var rand = random.Next(num);

        var attack = enemies[rand];

}

}

///

 

 

///

using System;

public class Hello{

    public static void Main(){

        var data = Console.ReadLine();

        string [] enemies = data.Split(',');

       

        foreach(var str in enemies)

        {

            Console.WriteLine(str + "が現れた!");

           

        }

        var num = enemies.Length;

        Console.WriteLine("敵は" + num + "");

        var random = new Random();

        var rand = random.Next(num);

        var attack = enemies[rand];

       

        Console.WriteLine(attack + "心の一" + attack + "を倒した");

    }

}

//랜덤으로 몬스터를 쓰러뜨리는 코드

 

//

using System;

public class Hello{

    public static void Main(){

        var data = Console.ReadLine();

        string [] team = data.Split(',');

       

        data = Console.ReadLine();

        string [] enemies = data.Split(',');

       

        foreach(var str in enemies)

        {

            Console.WriteLine(str + "が現れた!");

           

        }

        var num = enemies.Length;

       

        Console.WriteLine("敵は" + num + "");

        var random = new Random();

        var rand = 0;

        var attack = "";

       

        foreach(var str in team)

        {

            rand = random.Next(num);

            attack = enemies[rand];

        Console.WriteLine(str + "の攻!");

        Console.WriteLine(attack + "心の一!");    }

       

    }

}

//각 몬스터에 데미지를 주고 그것을 출력하는 것이 가능하다.

//입력: 勇者,,魔法使い,忍者

//スライム,モンスタ,ドラゴン,魔王

728x90

설정

트랙백

댓글