CCF认证真题-(201503-1)-图像旋转

it2022-05-05  111

1 #include <iostream> 2 #include <algorithm> 3 using namespace std; 4 int arr[1005][1005]; 5 int main() 6 { 7 ios::sync_with_stdio(false); 8 cin.tie(0); 9 int n, m; 10 cin >> n >> m; 11 for (int i = 1; i <= n; i++) 12 for (int j = 1; j <= m; j++) 13 cin >> arr[i][j]; 14 for (int i = m; i >= 1; i--) { 15 for (int j = 1; j <= n; j++) { 16 if (j == n) 17 cout << arr[j][i]; 18 else 19 cout << arr[j][i] << ' '; 20 } 21 cout << endl; 22 } 23 return 0; 24 }

 

转载于:https://www.cnblogs.com/AntonLiu/p/11165208.html


最新回复(0)