当前位置:网站首页>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);
}
}
}
结果:
边栏推荐
- Service的两种启动方式与区别
- JVM学习——3——数据一致性
- C语言每日一练——Day02:求最小公倍数(3种方法)
- 从苹果、SpaceX等高科技企业的产品发布会看企业产品战略和敏捷开发的关系
- 关于Android Service服务的面试题
- 语音信号处理:预处理【预加重、分帧、加窗】
- 软件测试基本流程有哪些?北京专业第三方软件检测机构安利
- Implement general-purpose, high-performance sorting and quicksort optimizations
- Unity游戏排行榜的制作与优化
- Daily sql--statistics the total salary of employees in the past three months (excluding the latest month)
猜你喜欢
TF中的四则运算
Daily sql-statistics of the number of professionals (including the number of professionals is 0)
【LeetCode每日一题】——682.棒球比赛
【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法
Pinduoduo API interface (attach my available API)
Edge 提供了标签分组功能
prometheus学习5altermanager
TF中使用softmax函数;
opencv实现数据增强(图片+标签)平移,翻转,缩放,旋转
如何选择专业、安全、高性能的远程控制软件
随机推荐
PIXHAWK飞控使用RTK
【@网络工程师:用好这6款工具,让你的工作效率大翻倍!】
DDR4内存条电路设计
常见激活函数及其导数
2022-08-09 第四小组 修身课 学习笔记(every day)
break pad源码编译--参考大佬博客的总结
How do you optimize the performance of your Unity project?
Unity游戏排行榜的制作与优化
pytorch,numpy两种方法实现nms类间+类内
Service的两种启动方式与区别
【软件测试】(北京)字节跳动科技有限公司二面笔试题
接口测试的基础流程和用例设计方法你知道吗?
Daily sql--statistics the total salary of employees in the past three months (excluding the latest month)
Redis源码-String:Redis String命令、Redis String存储原理、Redis字符串三种编码类型、Redis String SDS源码解析、Redis String应用场景
mysql视图与索引
从 dpdk-20.11 移植 intel E810 百 G 网卡 pmd 驱动到 dpdk-16.04 中
How Unity programmers can improve their abilities
oracle19c不支持实时同步参数,请教一下大佬们有什么好的解决办法吗?
囍楽云任务源码
关于Android Service服务的面试题