본문 바로가기

Algorithm/Algospot

[algospot]MERCY

문제

https://algospot.com/judge/problem/read/MERCY

문제의 이름만큼이나 알고스팟의 관리자는 매우 자비로웠다!.

입력

10이하의 양의 정수

출력

입력받은 횟수만큼 'Hello Algospot!' 을 찍어주면 된다.

풀이

그냥 입력받은 수만큼 운영자님의 자비를 느끼며 팍팍 ;;찍는다;

package com.tutorial;
import java.util.Scanner;
public class MERCY {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System. in);
        int cnt = sc.nextInt();
        while (cnt -- > 0) {
            System.out.println("Hello Algospot!");
        }
    }
}

 

'Algorithm > Algospot' 카테고리의 다른 글

[algospot]MISPELL  (0) 2014.12.11
[algospot]ENCRYPT  (0) 2014.12.11
[algospot]LECTURE  (0) 2014.12.11
[algospot]ENDIANS  (0) 2014.12.11
algospot start  (0) 2014.12.11