|
|
@ -381,7 +381,24 @@ void tipFunction(int grid[SIZE][SIZE]) { |
|
|
|
|
|
|
|
switch (option) { |
|
|
|
case 1: |
|
|
|
printf("Case 1\n"); |
|
|
|
printf("Enter the coordinates (row and column) separated by space:\n"); |
|
|
|
int row, col; |
|
|
|
|
|
|
|
while (true){ |
|
|
|
char row_str[10]; |
|
|
|
char col_str[10]; |
|
|
|
scanf("%s %s", row_str, col_str); |
|
|
|
|
|
|
|
|
|
|
|
row = row_str[0] - '0'; // Convert the first character to an integer |
|
|
|
col = col_str[0] - '0'; // Convert the first character to an integer |
|
|
|
|
|
|
|
if (((row >= 1 && row <= 9) && row_str[1] == '\0') && ((col >= 1 && col <= 9) && col_str[1] == '\0')) { |
|
|
|
break; |
|
|
|
} else { |
|
|
|
printf("Invalid input. Please enter a number between 1 and 9.\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
case 2: |
|
|
|