当前位置:网站首页>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
边栏推荐
- Pytorch学习记录(五):反向传播+基于梯度的优化器(SGD,Adagrad,RMSporp,Adam)
- Multithreading and high concurrency (1) -- basic knowledge of threads (implementation, common methods, state)
- The attendance client date of K / 3 wise system can only be selected to 2019
- Common programming records - parser = argparse ArgumentParser()
- Linear algebra Chapter 1 - determinant
- Anaconda installed pyqt5 and pyqt5 tools without designer Exe problem solving
- Delete and truncate
- On traversal of binary tree
- Pyqy5 learning (4): qabstractbutton + qradiobutton + qcheckbox
- Pytorch introduction notes - use a simple example to observe the output size of each layer of forward propagation
猜你喜欢

自动控制(韩敏版)

PyQy5学习(二):QMainWindow+QWidget+QLabel

Configure domestic image accelerator for yarn

Chapter 4 of line generation - linear correlation of vector systems
Best practices for MySQL storage time

Linear algebra Chapter 2 - matrices and their operations
![去噪论文阅读——[CVPR2022]Blind2Unblind: Self-Supervised Image Denoising with Visible Blind Spots](/img/fd/84df62c88fe90a73294886642036a0.png)
去噪论文阅读——[CVPR2022]Blind2Unblind: Self-Supervised Image Denoising with Visible Blind Spots

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

Class loading and classloader understanding

Preparedstatement prevents SQL injection
随机推荐
Font shape `OMX/cmex/m/n‘ in size <10.53937> not available (Font) size <10.95> substituted.
Pytorch notes - complete code for linear regression & manual or automatic calculation of gradient code comparison
Why does the subscript of the array start from 0 instead of 1?
ValueError: loaded state dict contains a parameter group that doesn‘t match the size of optimizer‘s
Pytoch learning record (x): data preprocessing + batch normalization (BN)
数字图像处理基础(冈萨雷斯)一
Multithreading and high concurrency (2) -- detailed explanation of synchronized usage
Pytorch学习记录(九):Pytorch中卷积神经网络
Anaconda
Pytorch学习记录(三):神经网络的结构+使用Sequential、Module定义模型
Pytorch学习记录(十一):数据增强、torchvision.transforms各函数讲解
Algèbre linéaire chapitre 2 - matrice et son fonctionnement
On traversal of binary tree
卡尔曼滤波与惯性组合导航
无监督去噪——[TMI2022]ISCL: Interdependent Self-Cooperative Learning for Unpaired Image Denoising
Use Matplotlib. In Jupiter notebook Pyplot server hangs up and crashes
JSP syntax and JSTL tag
線性代數第二章-矩陣及其運算
开发环境 EAS登录 license 许可修改
PyQy5学习(二):QMainWindow+QWidget+QLabel