Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int matrix[10][10] = {
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
- };
- int main(int argc, char *argv[])
- {
- int y, x;
- for (y = 0; y < 10; y++) {
- for (x = 0; x < 10; x++) {
- printf("%d ", matrix[y][x]);
- }
- printf("\n");
- }
- for (y = 0; y < 10; y++) {
- for (x = 0; x < 10; x++) {
- int x1 = x * (0) - y * (-1);
- int y1 = x * (1) + y * ( 0);
- matrix[y1][x1] |= (matrix[y][x] & 15) << 4;
- }
- }
- printf("\n");
- for (y = 0; y < 10; y++) {
- for (x = 0; x < 10; x++) {
- printf("%d ", matrix[y][x] >> 4);
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement