Your code is good, just get rid of the semicolon after the first cycle
so it would be:
public class Psttr {
public static void main(String[] args) {
Scanner h=new Scanner(System.in);
int n=h.nextInt();
int x=n;
for(int i=1;i<=n;i++){ // You can init "i" here
for(int j=1; j<=x--; j++) {
System.out.print("*");
}
x--; // You can use post-decrement (or pre, it's the same here)
System.out.print("
");
}
}
}
Also it seems you're quite new to programming so I added some little advice to write "better code"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…