Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Matrix rotation 90-degree
#include <stdio.h> #define EDGE 5 int main (void) { int matrix[][EDGE] = {{1, 2, 3, 4, 5}, {5, 6, 7, 8,9}, {9, 10, 11, 12,13}, {13, 14, 15, 16,17},{17,18,19,20,21}}; int temp[EDGE][EDGE]; int i = 0, j = 0, t = 0; for (i = 0; i < EDGE; ++i) { for (j = 0; j < EDGE; ++j) printf ("[%3d] ", matrix[i][j]); puts (""); } for (i = EDGE - 1; i >= 0; --i) { for (j = 0; j < EDGE; ++j) temp[j][t] = matrix[i][j]; ++t; } puts (""); for (i = 0; i < EDGE; ++i) { for (j = 0; j < EDGE; ++j) printf ("[%3d] ", temp[i][j]); puts (""); } }
run
|
edit
|
history
|
help
2
Bitwise Xor Swaping Two Variables
MEMORy eRROR
loop
4qwrfdsfsaf
sphere
A_141124_arrayMaxMin02
In Class 1.23.17 Bit operations
---DISEÑO DE TECLADO---
lab pro v.05
A_141201_MatrizTodosDistintos