Pyramid

This program makes upside down pyramids of numbers, with a decently advanced challenge

This program takes a number input from a file, and makes upside down pyramid of the number, some of the constraints are that numbers higher than 9 must use "*" until they reach the number 9, only accept numbers greater than 0, and you must format the pyramid with spaces. This was a timed challenge so efficiency wasn't taken into account. See results below


// Made by Kearnan Bishop on Tuesday, April 26th, 2022

package stuf;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class Pyramid {
	static int i = 1;

	public static void main(String[] args) throws IOException {
		start();

	}

	static int start() throws NumberFormatException, IOException {
		String fileName = "practice.in";
		String line;
		String ans;
		int d = 0;
		int tempd = 0;
		int spaces = 0;
		int x = 0;

		BufferedReader reader = new BufferedReader(new FileReader(fileName));

		if ((line = reader.readLine()) != null) {
			d = Integer.parseInt(line);
			tempd = Integer.parseInt(line);
		}
		
		
		while ((line = reader.readLine()) != null) {
			int inD = d;
			spaces = 0;
			for (int h = d; h >= 1; h--) {
				if (inD<2) {
					continue;
				}
				int num = d * 2;
				for (int c = 0; c <= spaces; c++) {
					System.out.print(" ");
				}
				if (d > 9) {
					int v = d;
					for (int i = 0; i < num; i++) {

						System.out.print("*");

					}
					System.out.println();
					spaces++;
					d--;
					tempd--;
				} else {
					for (int i = 0; i < num; i++) {

						System.out.print(d);

					}
					System.out.println();
					spaces++;
					d--;
					tempd--;
				}
			}

			spaces++;
			System.out.println();
			x = 0;
			i++;
			d = Integer.parseInt(line);
			tempd = Integer.parseInt(line);
		}
		return 1;
	}
}