[JAVA]SWEA 8016-奇数ピラミッド
import java.util.*;
class Solution
{
public static void main(String args[]) throws Exception
{
Scanner sc = new Scanner(System.in);
StringBuffer sb = new StringBuffer();
int T = sc.nextInt();
for(int tc=1; tc<=T; tc++){
sb.append("#").append(tc).append(" ");
long N = sc.nextInt();
sb.append((N-1)*(N-1)*2+1).append(" ");
sb.append(N*N*2-1).append("\n");
}
System.out.println(sb);
}
}
Reference
この問題について([JAVA]SWEA 8016-奇数ピラミッド), 我々は、より多くの情報をここで見つけました https://velog.io/@gkdud583/JAVA-SWEA-8016-홀수-피라미드テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol