Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
right swastik
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.Scanner; class Rextester { public static void main(String args[]) { Scanner in=new Scanner(System.in); int n=in.nextInt(); System.out.print("*"); for(int i=1;i<=n-2;i++) System.out.print(" "); for(int j=1;j<=n;j++) System.out.print("*"); System.out.println(); for(int k=1;k<=n;k++){ System.out.print("*"); for(int l=1;l<=n-2;l++) System.out.print(" "); System.out.print("*"); System.out.println(); } for(int m=1;m<=2*n;m++) System.out.print("*"); System.out.println(); for(int o=1;o<=n;o++){ for(int p=1;p<=n-1;p++) System.out.print(" "); System.out.print("*"); for(int q=1;q<=n-1;q++) System.out.print(" "); System.out.println("*"); } for(int r=1;r<=n;r++) System.out.print("*"); for(int s=1;s<=n-1;s++) System.out.print(" "); System.out.println("*"); System.out.println(); } }
5
[
-
]
Show input
Compilation time: 1.55 sec, absolute running time: 0.32 sec, cpu time: 0.37 sec, memory peak: 20 Mb, absolute service time: 1,88 sec
edit mode
|
history
|
discussion
* ***** * * * * * * * * * * ********** * * * * * * * * * * ***** *