MISSPELL 튜토리얼 문제인제 왜 자꾸 런타임 오류가 뜨는지 ㅠㅠㅠㅠㅠ zmfldlwl import java.util.*; class Picnic { public static void main(String[] args) { Scanner s = new Scanner(System.in); int testcase = s.nextInt(); s.nextLine(); if(testcase <= 0) return; int[] location = new int[testcase]; String[] value = new String[testcase]; for(int i=0;i<testcase;i++) { String[] temp = (s.nextLine()).split(" "); location[i] = Integer.parseInt(temp[0]); if(location[i] >= 1 && location[i] <= 1000) if(value[i].length() < 80) value[i] = temp[1]; else return ; } for(int i=0;i<testcase;i++) { char[] result = new char[value[i].length()]; result = value[i].toCharArray(); result[location[i] - 1] = ' '; System.out.print((i+1) + " "); for(int j=0;j<result.length;j++) { if(result[j] != ' ') System.out.print(result[j]); } System.out.println(); } s.close(); } } 11년 전
1개의 댓글이 있습니다. JongMan [[알고스팟 온라인 저지/첫 번째 문제 풀기]] 참조하세요. public class 이름은 Main이어야 합니다. 11년 전 link 정회원 권한이 있어야 커멘트를 다실 수 있습니다. 정회원이 되시려면 온라인 저지에서 5문제 이상을 푸시고, 가입 후 7일 이상이 지나셔야 합니다. 현재 문제를 푸셨습니다.
zmfldlwl
import java.util.*;
class Picnic
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
int testcase = s.nextInt(); s.nextLine();
if(testcase <= 0)
return;
int[] location = new int[testcase];
String[] value = new String[testcase];
}
11년 전