You are viewing a single comment's thread. Return to all comments →
i tried the same.. and output is also looking same but getting the wrong answer. can anyone explain why is it so?
how about this in java
Scanner in = new Scanner(System.in);
int n = in.nextInt(),i=0;
while(++i <= n)
System.out.println(new String(new char[n-i]).replace("\0", " ")+new String(new char[i]).replace("\0", "#"));