当前位置:网站首页>Acwing727. Diamond pattern
Acwing727. Diamond pattern
2022-07-26 11:50:00 【mfg_】

Manhattan distance

// Manhattan distance
import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int cx=n/2;
int cy=n/2;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(Math.abs(i-cx)+Math.abs(j-cy)<=n/2){
System.out.print("*");
}else{
System.out.print(" ");
}
}
System.out.println();// Line break
}
}
}
边栏推荐
猜你喜欢
![[error reported]exception: found duplicate column (s) in the data schema: `value`;](/img/df/ca676633ca6d5e8c0a870be0732707.png)
[error reported]exception: found duplicate column (s) in the data schema: `value`;

Hashtable

外包干了四年,废了...

了解 useRef 一篇就够了

28.文件目录解析代码实现

Outsourcing for four years, abandoned

Redis database, which can be understood by zero foundation Xiaobai, is easy to learn and use!

Hal library IIC simulation in punctual atom STM32 `define SDA_ IN() {GPIOB->MODER&=~(3<<(9*2));GPIOB->MODER|=0<<9*2;}` // PB9 input mode

安科瑞余压监控系统在住宅小区的应用方案

Basic recursive equation of DP
随机推荐
Load orb dictionary
An error occurred in the scrapy shell
Mongodb - use $type to query whether the type of a field is XXX
如何使用数据管道实现测试现代化
Modeling essay series 150 SCLC engineering experiment 3-srule
【云驻共创】解密SparkRTC如何在全球实现超低时延交互
[error reported]exception: found duplicate column (s) in the data schema: `value`;
7月27日19:30直播预告:HarmonyOS3及华为全场景新品发布会
Data center construction (II): brief introduction to data center
An online duplicate of a hidden bug
Back to the top of several options (JS)
10 个 Reduce 常用“奇技淫巧”
打造绿色数据中心,Colt DCS 是认真的!
绝对路径打开文件相比数据库查询哪个更快?
"Mongodb" mongodb high availability deployment architecture - replica set
Data Lake (19): SQL API reads Kafka data and writes it to iceberg table in real time
【万字长文】使用 LSM-Tree 思想基于.Net 6.0 C# 实现 KV 数据库(案例版)
Data type of SQL Server database
初试YOLOv7
Recalling Sister Feng