Java组代码
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner =new Scanner(System.in); int n=scanner.nextInt(); int m=scanner.nextInt(); StringBuilder sb=new StringBuilder(); if (m*3>n){ System.out.println(-1); }else{ for (int i = 0; i <m; i++) { sb.append("you"); } } for (int i = 0; i <n-3*m; i++) { sb.append("y"); } System.out.println(sb.toString()); } }
标签:java,scanner,nextInt,int,System,牛客,Round4,Scanner From: https://www.cnblogs.com/liliczw2209/p/17576059.html