返回列表 發帖

a015: 矩陣的翻轉

http://zerojudge.tw/ShowProblem?problemid=a015
  1. #include <iostream> //引入函數庫
  2. #include <cstdlib>

  3. using namespace std;
  4. int main(void){


  5.     int a[100][100] = {0};
  6.    
  7.     int b=0,c=0;
  8.    
  9.     a[0][0] = 3;a[0][1] = 1;a[0][2] = 2;
  10.     a[1][0] = 8;a[1][1] = 5;a[1][2] = 4;
  11.    
  12.     b=2 ; c=3;
  13.    
  14.     for(int j=0;j<c;j++){
  15.              for(int i=0;i<b;i++)
  16.              {
  17.                     cout << a[i][j];
  18.                     cout << " ";      
  19.              }
  20.              cout << '\n';     
  21.     }

  22.    
  23.    
  24.    




  25.     system("pause");
  26.     return 0;
  27. }
複製代碼

譯仁明明有寫出來,怎麼沒有PO?

TOP

返回列表