Java Карнавална Маска
Някакви идеи защо judge ми оценява задачата с 0/100, а eclipse ми чертае 1 към 1 с фигурките?
package FundamentalsTest;
import java.util.Scanner;
public class First {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.nextLine());
for(int i=1; i<n; i++){
System.out.print(new String(new char[(n-i-1)]).replace("\0", "\0"));
System.out.print("/");
System.out.print(new String(new char[(i-1)]).replace("\0", "\0"));
System.out.print("|");
System.out.print(new String(new char[2]).replace("\0", "\0"));
System.out.print("|");
System.out.print(new String(new char[(i-1)]).replace("\0", "\0"));
System.out.println("\\");
}
System.out.println(new String(new char[(n*2+2)]).replace("\0", "-"));
System.out.print("|");
System.out.print(new String(new char[(n-3)/2]).replace("\0", "\0"));
System.out.print("_");
System.out.print(new String(new char[(n+1)]).replace("\0", "\0"));
System.out.print("_");
System.out.print(new String(new char[(n-3)/2]).replace("\0", "\0"));
System.out.println("|");
System.out.print("|");
System.out.print(new String(new char[(n-3)/2]).replace("\0", "\0"));
System.out.print("@");
System.out.print(new String(new char[(n+1)]).replace("\0", "\0"));
System.out.print("@");
System.out.print(new String(new char[(n-3)/2]).replace("\0", "\0"));
System.out.println("|");
for(int i=0; i<(n-1)/2; i++){
System.out.print("|");
System.out.print(new String(new char[(n*2)]).replace("\0", "\0"));
System.out.println("|");
}
System.out.print("|");
System.out.print(new String(new char[(n-1)]).replace("\0", "\0"));
System.out.print("OO");
System.out.print(new String(new char[(n-1)]).replace("\0", "\0"));
System.out.println("|");
System.out.print("|");
System.out.print(new String(new char[(n-2)]).replace("\0", "\0"));
System.out.print("/");
System.out.print(new String(new char[2]).replace("\0", "\0"));
System.out.print("\\");
System.out.print(new String(new char[(n-2)]).replace("\0", "\0"));
System.out.println("|");
System.out.print("|");
System.out.print(new String(new char[(n-2)]).replace("\0", "\0"));
System.out.print("||||");
System.out.print(new String(new char[(n-2)]).replace("\0", "\0"));
System.out.println("|");
for(int i=1; i<=n+1; i++){
System.out.print(new String(new char[i]).replace("\0", "\\"));
System.out.print(new String(new char[n*2+2-2*i]).replace("\0", "`"));
System.out.println(new String(new char[i]).replace("\0", "/"));
}
}
}
Благодаря ти много! :)