/** * 【题目名称】字符三角形p * 【题目来源】http://noi.openjudge.cn/ch0101/08/ * * author 潘磊just_panleijust.edu.cn * version 1.0 */importjava.util.Scanner;publicclassMain{publicstaticvoidmain(String[]args){ScannerinputnewScanner(System.in);charcinput.next().charAt(0);// 构成三角形的字符System.out.println( c);// 输出三角形第一行包含两个空格和一个字符System.out.println( ccc);// 输出三角形第二行包含一个空格和三个字符System.out.print(ccccc);// 输出三角形第三行包含五个字符前缀用于拼接五个字符}}
08:字符三角形
/** * 【题目名称】字符三角形p * 【题目来源】http://noi.openjudge.cn/ch0101/08/ * * author 潘磊just_panleijust.edu.cn * version 1.0 */importjava.util.Scanner;publicclassMain{publicstaticvoidmain(String[]args){ScannerinputnewScanner(System.in);charcinput.next().charAt(0);// 构成三角形的字符System.out.println( c);// 输出三角形第一行包含两个空格和一个字符System.out.println( ccc);// 输出三角形第二行包含一个空格和三个字符System.out.print(ccccc);// 输出三角形第三行包含五个字符前缀用于拼接五个字符}}