SWEA 6718 희성이의 원근법

1 개요[ | ]

SWEA 6718 희성이의 원근법
SW Expert 아카데미
# 문제 풀이

틀:SWEA 난이도 3-1

2 C++[ | ]

3 Java[ | ]

import java.util.*; 
class Solution 
{
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        int d, score;
        for(int tc=1; tc<=T; tc++) {
            d = sc.nextInt();
            if( d < 100 ) score = 0;
            else if( d < 1000 ) score = 1;
            else if( d < 10000 ) score = 2;
            else if( d < 100000 ) score = 3;
            else if( d < 1000000 ) score = 4;
            else score = 5;
            System.out.format("#%d %d\n", tc, score);
        }
        sc.close();
    } 
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}