Generation

generate functionMon, 08 May 2023

for 文や if 文などを駆使して、以下の実行結果になるように,プログラム(Kadai01t_1.java)を作成せよ. Kadai01t.java の実行結果 学籍番号:C0xxxxxxx 氏名:工科太郎 -----$$$$$-----$$$$$ $-----$$$$$-----$$$$ $$-----$$$$$-----$$$ $$$-----$$$$$-----$$ $$$$-----$$$$$-----$ $$$$$-----$$$$$-----

public class Kadai01t_1 { public static void main(String[] args) { System.out.println("学籍番号:" + args[0]); System.out.println("氏名:" + args[1]); for(int i=0;i<5;i++) { for(int j=0;j<5;j++) { if (j==i||j==9-i) { System.out.print("$"); } else { System.out.print("-"); } } System.out.println(); } } }

Want to kickstart your project?Use the new AI Studio to create your code