Esempio n. 1
0
File: main.c Progetto: dhdnzk/sudoku
int main(void)
{
	//풀리지 않은 문제 수
	int totalCount = 0;	
	//임시 count
	int Count = 0;
	int x, y;
	Element board[ROW_LEN][LINE_LEN];
	
	if (ReadQuizFile(board, &totalCount) == -1)
	return 0;


	//문제 출력
	printf("문제\n");
	printf("풀어야 할 문제 : %d\n", totalCount);
	for(y = 0; y < ROW_LEN; y++) {
		for(x = 0; x < LINE_LEN; x++) {
			if(board[y][x].firmedElement == 0)
				printf("   ");
			else
				printf(" %d ", board[y][x].firmedElement);
		}
		printf("\n");
	}

	
	//배열 요소 중 남아있는 0이 없을때까지 진행
	while (Count != 100) {
		Calc1(board, &totalCount);
		Calc2(board, &totalCount);
		Count++;
	}
	
	printf("\n풀이 결과\n");
	printf("못 푼 문제 : %d개\n", totalCount);

	for (y = 0; y < ROW_LEN; y++) {
		for ( x = 0; x < LINE_LEN; x++) {
			if(board[y][x].firmedElement == 0)
				printf("   ");
			else
				printf(" %d ", board[y][x].firmedElement);
		}
		printf("\n");
	}
	printf("\n");
	return 0;
	}
Esempio n. 2
0
int main()
{
	Calc1();
}