当前位置:网站首页>1036 跟奥巴马一起编程 (15 分)
1036 跟奥巴马一起编程 (15 分)
2022-08-11 06:46:00 【呆比特】
题目要求:
代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
//輸入
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
String c = scanner.next();
//先打印第一行
for (int i = 0; i < n; i++){
System.out.print(c);
}
System.out.println();
//再打印n-1行
for (int i = 0; i < Math.round(n * 0.5-2); i++){
System.out.print(c);
for (int k = 0; k < n-2; k++)
System.out.print(" ");
System.out.println(c);
}
//打印最后一行
for (int i = 0; i < n; i++){
System.out.print(c);
}
}
}
结果:
边栏推荐
- 软件测试主要做什么工作,难不难?
- Shell:三剑客之awk
- Redis源码-String:Redis String命令、Redis String存储原理、Redis字符串三种编码类型、Redis String SDS源码解析、Redis String应用场景
- 详述MIMIC 的ICU患者检测时间信息表(十六)
- 【@网络工程师:用好这6款工具,让你的工作效率大翻倍!】
- Pytorch模型转ONNX模型
- Daily sql: request for friend application pass rate
- LeetCode brushing series -- 46. Full arrangement
- 一张图了解JVM八大原子操作
- 数仓开发知识总结
猜你喜欢

【latex异常和错误】Missing $ inserted.<inserted text>You can‘t use \spacefactor in math mode.输出文本要注意特殊字符的转义

接口测试的基础流程和用例设计方法你知道吗?

Pinduoduo API interface (attach my available API)

公牛10-11德里克·罗斯最强赛季记录

1688 product interface

STM32CUBEIDE(11)----输出PWM及修改PWM频率与占空比

6月各手机银行活跃用户较快增长,创半年新高

【@网络工程师:用好这6款工具,让你的工作效率大翻倍!】

Coordinate system in navigation and positioning

tf.cast(),reduce_min(),reduce_max()
随机推荐
prometheus学习5altermanager
微信小程序功能上新(2022.06.01~2022.08.04)
Daily sql--statistics the total salary of employees in the past three months (excluding the latest month)
深度监督(中继监督)
matplotlib
从何跟踪伦敦金最新行情走势?
concept noun
Pico neo3 Unity打包设置
Daily sql: request for friend application pass rate
【预约观看】Ambire 智能钱包 AMA 活动第四期即将举行
tf中自减操作;tf.assign_sub()
公牛10-11德里克·罗斯最强赛季记录
1003 我要通过 (20 分)
JVM学习——3——数据一致性
TF通过feature与label生成(特征,标签)集合,tf.data.Dataset.from_tensor_slices
Find the shops that have sold more than 1,000 yuan per day for more than 30 consecutive days in the past six months
Douyin get douyin share password url API return value description
NTT的Another Me技术助力创造歌舞伎演员中村狮童的数字孪生体,将在 “Cho Kabuki 2022 Powered by NTT”舞台剧中首次亮相
【Pytorch】nn.Linear,nn.Conv
Edge 提供了标签分组功能