by CodeChum Admin
Somehow, in some way, you find yourself in a dimension within a dimension. Traverse the dimension and look for the exit!
Instructions:
Instructions
Input
A single int input
1
Output
2 int outputs separated by a space
0·0
---------------to fill up code--------------------
#include<stdio.h>
int main() {
int exit;
scanf("%d", &exit);
int col_row[5][5] = {{1,2,3,4,5},{6,7,8,9,10},
{11,12,13,14,15},{16,17,18,19,20},{21,22,23,24,25}};
}
#include<stdio.h>
int main()
{
int exit;
scanf("%d", &exit);
int col_row[5][5] = {
{ 1, 2, 3, 4, 5 },
{ 6, 7, 8, 9, 10 },
{ 11, 12, 13, 14, 15 },
{ 16, 17, 18, 19, 20 },
{ 21, 22, 23, 24, 25 }
};
for (int i = 0; i < 5; i = i + 1) {
for (int j = 0; j < 5; j = j + 1) {
if (col_row[i][j] == exit) {
printf("%d %d\n", i, j);
return 0;
}
}
}
return 0;
}
Comments
Leave a comment