题解 | #线段图案#

线段图案

http://www.nowcoder.com/practice/a95744270f274a14a8a0dafe10421589

import java.util.Scanner;
import java.util.Collections;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNextInt()) {
            int num = scan.nextInt();
            System.out.println(String.join("",Collections.nCopies(num, "*")));
        }
    }
}
全部评论

相关推荐

12-27 22:35
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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