题解 | #牛牛的字符菱形#

牛牛的字符菱形

http://www.nowcoder.com/practice/11a5040fa894430f9d25fda1be37ddc8

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner myScanner = new Scanner(System.in); char ch = myScanner.next().charAt(0); for(int i = 0; i < 3 ;i++) { for(int j = 0; j < 2-i ;j++) { System.out.print(' '); } for(int k = 0; k < 2 * i + 1 ;k++) { System.out.print(ch); } System.out.println(""); } for(int i = 0; i < 2 ;i++) { for(int j = 0; j < i+1 ;j++) { System.out.print(' '); } for(int k = 0; k < 2*(2-i)-1 ;k++) { System.out.print(ch); } System.out.println(""); } } }

全部评论

相关推荐

仁者伍敌:牛子这些人还会点一个自动回复,boss都不带回复的
点赞 评论 收藏
分享
07-02 10:39
门头沟学院 Java
Steven267:说点真实的,都要秋招了,还没有实习,早干嘛去了,本来学历就差,现在知道急了,而且你这个简历完全可以写成一页,劣势太大了,建议转测试
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务