RioTian


私信TA

用户名:jiahe

访问量:30812

签 名:

2021加油

等  级
排  名 76
经  验 9480
参赛次数 2
文章发表 78
年  龄 0
在职情况 学生
学  校 XX理工大学
专  业 软件工程

  自我简介:

个人博客:https://www.cnblogs.com/RioTian/

 

0.0分

2 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区

#include<stdio.h>
#include <stdlib.h>
 int hf[3][3],ms[3][3],a[10];
 int count=0;
 
 int get_ms(){
     for(int i=0;i<3;i++){
         if(hf[0][i]+hf[1][i]+hf[2][i]!=15)return 0;
         if(hf[i][0]+hf[i][1]+hf[i][2]!=15)return 0;
     }
     if(hf[0][0]+hf[1][1]+hf[2][2]!=15)return 0;
     if(hf[0][2]+hf[1][1]+hf[2][0]!=15)return 0;
     return 1;
 }
 
 void dfs(int pos){
     if(pos==9){
         if(get_ms()){
             ++count;
             for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 3; j++) {
                    ms[i][j] = hf[i][j]; 
                }
2023-12-15 11:34:51
  • «
  • 1
  • »