백준 #27310번 :chino_shock:

jhj·2024년 2월 16일

백준 JAVA

목록 보기
350/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String a = sc.next();
		int n = 0;
		int m = 0;
		
		for(int i = 0; i < a.length(); i++) {
			if(a.charAt(i) == ':') {
				n++;
			}
			
			if(a.charAt(i) == '_') {
				m++;
			}
		}
		int total = a.length() + n + m * 5;
		System.out.println(total);
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글