왜 wrong answer일까요?

alexander Reply 8 years 30 weeks ago
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); int ISBN = input.nextInt(); int d1 = ISBN / 100000000; int d2 = ISBN / 10000000 % 10; int d3 = ISBN / 1000000 % 10; int d4 = ISBN / 100000 % 10; int d5 = ISBN / 10000 % 10; int d6 = ISBN / 1000 % 10; int d7 = ISBN / 100 % 10; int d8 = ISBN / 10 % 10; int d9 = ISBN % 10; int d10 = ( d1 * 1 + d2 * 2 + d3 * 3 + d4 * 4 + d5 * 5 + d6 * 6 + d7 * 7 + d8 * 8 + d9 * 9) % 11; int ISBN_10 = ISBN * 10 + d10; if (d1 == 0 && d10 !=10) System.out.println ("\u0030" + ISBN_10); else System.out.println ((d10 == 10) ? ISBN + "\u0058" : ISBN_10); } }
pichulia Reply 8 years 30 weeks ago
ISBN_10을 저장하기엔 int라는 자료구조는 너무 자그마하네요. 5으로 시작하는 예쩨 아무거나 넣어보세요