Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The C language can only realize the Sudoku program.

2025-04-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "C language can only realize the unique program of solving numbers". The editor shows you the operation process through the actual case, the operation method is simple and fast, and the practicality is strong. I hope that this article "C language can only realize the unique program of solving numbers" can help you solve the problem.

A program for solving Sudoku written in C language. The test runs successfully under linux.

The effect is as shown in the figure:

This is Sudoku with a solution, and the part that needs to be filled in is replaced by the number 0.

This is the effect picture after the program is running. Look, Sudoku is done.

The source code of the program is as follows:

# include # include # define SIZE 9#define get_low_bit (x) ((~ x & (xmer1)) + 1) struct {int left; char num; char try;} board [SIZE] [SIZE]; int bit2num (int bit) {switch (bit) {case 1:case 2: return bit; case 4: return 3; case 8: return 4; case 16: return 5; case 32: return 6; case 64: return 7; case 128: return 8; case 256: return 9 }} void printf_res () {int I, j, k; for (iTuno; I

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

  • How to use Html to add, delete and right-click menus

    This article will explain in detail how to use Html to add, delete, and right-click menus. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article. The code is as follows:

    © 2024 shulou.com SLNews company. All rights reserved.

    12
    Report