Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

System.out.printf("%"+(n)+"s ")

public class Staircase {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		String str = "#";
		for (int i = 0; i < n; i++) {
			System.out.printf("%" + (n) + "s 
", str);
			str += "#";
		}
		in.close();
	}
}
Comment

PREVIOUS NEXT
Code Example
Java :: java check string contains uppercase character 
Java :: The this(Keyword) 
Java :: jdk 15 download brew 
Java :: Calling User-Defined Method in Java 
Java :: get array element java 
Java :: java.lang.NullPointerException 
Java :: breadth first search bst java 
Java :: hashmap get value by key java 
Java :: what is jvm jdk and jre 
Java :: java singleton 
Java :: even and odd java & 
Java :: actuator spring boot 
Java :: java difference hashmap hashtable 
Java :: adjust font scale in android studio 
Java :: android java show hide keyboard: 
Java :: do you need java installed for kafka 
Java :: why enable multidex android 
Java :: android iterate through radio group java 
Java :: android java how to blur an image 
Java :: Float to bytes java 
Java :: how to change toolbar name in android studio 
Java :: multiple inheritance using interface in java 
Java :: android handler clear message queue 
Java :: java fields 
Java :: java print a line seperate by space 
Java :: ArrayList of prime numbers 
Java :: object creation in java 
Java :: dowload htpasswd file java 
Java :: how to convert string hashcode to color in java android 
Java :: How to perform an iterative inorder traversal through a binary search tree, in Java? 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =