返回列表 發帖
竟然變成第3名了= =  恨阿~~~(小笨魚  不要一直做人身攻擊好嗎   沒品結)
  1. //陳繹仁  製 !@#$%^&*()_+   排版有點亂= =  請多包涵
  2. #include <iostream>
  3. #include <cstdlib>
  4. using namespace std;
  5. int main(void){
  6.     const int z=9;
  7.     int a[z][z];
  8.     int total,total2,no;
  9.     while (true){
  10.           total=0;total2=0;
  11.           no=0;
  12.           for (int i = 0; i < z; i++){
  13.               for (int j = 0; j < z; j++){
  14.                        cin >> a[i][j];
  15.                        }
  16.               }
  17.               for (int i=0;i<z;i++){
  18.                    for (int j=0;j<z;j++){
  19.                        total += a[i][j];
  20.                              total2 += a[j][i];
  21.               }
  22.               if (total !=45 || total2 !=45){
  23.                         no++;
  24.                         }
  25.               total=0;
  26.               total2=0;
  27.               }
  28.           for (int i=0;i<9;i+=3){
  29.               for (int j=0;j<9;j+=3){
  30.                   for (int z=i;z<i+3;z++){
  31.                       for (int x=j;x<j+3;x++){
  32.                           total+=a[z][x];
  33.                       }
  34.                   }
  35.                   if(total !=45){
  36.                       no++;
  37.                   }
  38.                   total=0;
  39.               }   
  40.           }         
  41.           if (no>0){
  42.               cout<<"no"<<endl;      
  43.           }else{
  44.               cout<<"yes"<<endl;   
  45.           }
  46.     }
  47. system("pause");
  48. return 0;
  49. }
  50. //!@#$%^&*()_+   麻煩死了= =   !@#$%^&*()_+
複製代碼
分數掛蛋的心情像空白的紙,再次期望著奇蹟的到來。

TOP

怎麼辦~~一直都是逾時= =
怎麼辦啦    你們是怎用到成功ㄉ哩    怪怪哩    阿哩??
請幫幫偶~~
分數掛蛋的心情像空白的紙,再次期望著奇蹟的到來。

TOP

返回列表