Skip to content

Instantly share code, notes, and snippets.

@duyet
Last active August 29, 2015 14:05
Show Gist options
  • Save duyet/06b5fe75d915e41a32dc to your computer and use it in GitHub Desktop.
Save duyet/06b5fe75d915e41a32dc to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main() {
int m, n, i;
int j = -1, k = -1;
printf("Input m, n, i: ");
scanf_s("%d%d%d", &m, &n, &i);
for (int x = 0; x <= m; x++)
for (int y = 0; y <= n; y++)
if (x * n + y + 1 == i) {
j = x;
k = y;
}
printf("Output: %d %d", j, k+1);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment