#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]; }
C语言训练-排序问题<1> (C++代码)浏览:589 |
【明明的随机数】 (C++代码)浏览:779 |
十->二进制转换 (C语言代码)浏览:1291 |
字符串的输入输出处理 (C语言代码)浏览:922 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:1028 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:464 |
求圆的面积 (C语言代码)浏览:1666 |
IP判断 (C语言代码)浏览:532 |
复数求和 (C语言代码)浏览:915 |
C语言训练-大、小写问题 (C语言代码)浏览:674 |