竟然變成第3名了= = 恨阿~~~(小笨魚 不要一直做人身攻擊好嗎 沒品結)- //陳繹仁 製 !@#$%^&*()_+ 排版有點亂= = 請多包涵
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main(void){
- const int z=9;
- int a[z][z];
- int total,total2,no;
- while (true){
- total=0;total2=0;
- no=0;
- for (int i = 0; i < z; i++){
- for (int j = 0; j < z; j++){
- cin >> a[i][j];
- }
- }
- for (int i=0;i<z;i++){
- for (int j=0;j<z;j++){
- total += a[i][j];
- total2 += a[j][i];
- }
- if (total !=45 || total2 !=45){
- no++;
- }
- total=0;
- total2=0;
- }
- for (int i=0;i<9;i+=3){
- for (int j=0;j<9;j+=3){
- for (int z=i;z<i+3;z++){
- for (int x=j;x<j+3;x++){
- total+=a[z][x];
- }
- }
- if(total !=45){
- no++;
- }
- total=0;
- }
- }
- if (no>0){
- cout<<"no"<<endl;
- }else{
- cout<<"yes"<<endl;
- }
- }
- system("pause");
- return 0;
- }
- //!@#$%^&*()_+ 麻煩死了= = !@#$%^&*()_+
複製代碼 |