当前位置:网站首页>4. Print form
4. Print form
2022-04-23 06:08:00 【linsa_ pursuer】
Print a n×m In our table, we define the unit length ( There are three in the horizontal direction “-”, There is a vertical “|”,“|” alignment “+”) Giant table
Only one line of input contains two integers n and m(0<n,m<13); Output n×m Table for
package com;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
print(s.nextInt(),s.nextInt());
}
public static void print(int a,int b){
for(int i=1; i<=a; i++){
String lineOne = "+";
String lineTwo = "|";
for(int j=1; j<=b; j++){
lineOne += "---+";
lineTwo += " |";
}
if(i==1){
System.out.println(lineOne);
}
System.out.println(lineTwo);
System.out.println(lineOne);
}
}
}
Such as :
Input :1 2
Output :
+---+---+
| | |
+---+---+
版权声明
本文为[linsa_ pursuer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220533259889.html
边栏推荐
- 去噪论文阅读——[RIDNet, ICCV19]Real Image Denoising with Feature Attention
- 线性代数第二章-矩阵及其运算
- What is the difference between the basic feasible solution and the basic feasible solution in linear programming?
- PHP processing JSON_ Decode() parses JSON stringify
- 图像恢复论文简记——Uformer: A General U-Shaped Transformer for Image Restoration
- Pytorch学习记录(九):Pytorch中卷积神经网络
- Fundamentals of SQL: first knowledge of database and SQL - installation and basic introduction - Alibaba cloud Tianchi
- Algèbre linéaire chapitre 1 - déterminants
- Chapter 3 of linear algebra - Elementary Transformation of matrix and system of linear equations
- How to use comparative learning to do unsupervised - [cvpr22] training & [eccv20] image translation
猜你喜欢
Programming record - picture rotation function SciPy ndimage. Simple use and effect observation of rotate()
去噪论文阅读——[CVPR2022]Blind2Unblind: Self-Supervised Image Denoising with Visible Blind Spots
How to use comparative learning to do unsupervised - [cvpr22] training & [eccv20] image translation
解决报错:ImportError: IProgress not found. Please update jupyter and ipywidgets
Anaconda安装PyQt5 和 pyqt5-tools后没有出现designer.exe的问题解决
PyEMD安装及简单使用
Latex快速入门
CONDA virtual environment management (create, delete, clone, rename, export and import)
图像恢复论文简记——Uformer: A General U-Shaped Transformer for Image Restoration
Latex quick start
随机推荐
Shansi Valley P290 polymorphism exercise
Best practices for MySQL storage time
Why does the subscript of the array start from 0 instead of 1?
IO multiplexing of 09 redis
治療TensorFlow後遺症——簡單例子記錄torch.utils.data.dataset.Dataset重寫時的圖片維度問題
A general U-shaped transformer for image restoration
Pytorch学习记录(三):神经网络的结构+使用Sequential、Module定义模型
K/3 WISE系统考勤客户端日期只能选到2019年问题
Remedy after postfix becomes a spam transit station
无监督去噪——[TMI2022]ISCL: Interdependent Self-Cooperative Learning for Unpaired Image Denoising
PyTorch笔记——观察DataLoader&用torch构建LeNet处理CIFAR-10完整代码
Programming record - picture rotation function SciPy ndimage. Simple use and effect observation of rotate()
开发环境 EAS登录 license 许可修改
编程记录——图片旋转函数scipy.ndimage.rotate()的简单使用和效果观察
线性代数第一章-行列式
Pyqt5 learning (I): Layout Management + signal and slot association + menu bar and toolbar + packaging resource package
Pyqy5 learning (4): qabstractbutton + qradiobutton + qcheckbox
Numpy common function table sorting of data processing
Solve the error: importerror: iprogress not found Please update jupyter and ipywidgets
Pytorch学习记录(五):反向传播+基于梯度的优化器(SGD,Adagrad,RMSporp,Adam)