当前位置:网站首页>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
- lambda expressions
- Fundamentals of digital image processing (Gonzalez) I
- Pytorch学习记录(九):Pytorch中卷积神经网络
- Contrôle automatique (version Han min)
- Multithreading and high concurrency (3) -- synchronized principle
- umi官网yarn create @umijs/umi-app 报错:文件名、目录名或卷标语法不正确
- Automatic control (Han min version)
- Create enterprise mailbox account command
- Understanding and use of tp50, tp90 and tp99
猜你喜欢

Programming record - picture rotation function SciPy ndimage. Simple use and effect observation of rotate()

lambda expressions

Pytorch学习记录(十三):循环神经网络((Recurrent Neural Network)
Best practices for MySQL storage time
![去噪论文阅读——[RIDNet, ICCV19]Real Image Denoising with Feature Attention](/img/4e/1a51636853d11544e6f5c37a588730.png)
去噪论文阅读——[RIDNet, ICCV19]Real Image Denoising with Feature Attention

Filebrowser realizes private network disk

Anaconda

Fundamentals of digital image processing (Gonzalez) II: gray transformation and spatial filtering

Chapter 3 of linear algebra - Elementary Transformation of matrix and system of linear equations

A sharp tool to improve work efficiency
随机推荐
Pytorch learning record (7): skills in processing data and training models
数字图像处理基础(冈萨雷斯)一
You cannot access this shared folder because your organization's security policy prevents unauthenticated guests from accessing it
Pytorch学习记录(十三):循环神经网络((Recurrent Neural Network)
RedHat realizes keyword search in specific text types under the directory and keyword search under VIM mode
Pytorch notes - get familiar with the network construction method by building RESNET (complete code)
container
Automatic control (Han min version)
Postfix变成垃圾邮件中转站后的补救
Linear algebra Chapter 2 - matrices and their operations
Pytorch notes - complete code for linear regression & manual or automatic calculation of gradient code comparison
Pytorch学习记录(四):参数初始化
Fact final variable and final variable
JDBC connection database
Pytorch学习记录(十二):学习率衰减+正则化
Pytorch——数据加载和处理
深入理解去噪论文——FFDNet和CBDNet中noise level与噪声方差之间的关系探索
Denoising paper - [noise2void, cvpr19] noise2void learning denoising from single noise images
线性代数第一章-行列式
The problem that the page will refresh automatically after clicking the submit button on the form is solved