Skip to content

Instantly share code, notes, and snippets.

@nesffer
Created May 3, 2015 15:14
Show Gist options
  • Save nesffer/791bf920465d7edbc14b to your computer and use it in GitHub Desktop.
Save nesffer/791bf920465d7edbc14b to your computer and use it in GitHub Desktop.
구구단 과제
#include <stdio.h>
int main() {
int i, j;
printf("%22s\n\n", "구 구 단");
printf("%6s %8s %8s %8s\n", "2단", "3단", "4단", "5단");
for (i = 1; i < 10; i++) {
for (j = 2; j < 6; j++) {
printf("%d*%d = %2d ", j, i, i*j);
}
printf("\n");
}
printf("\n");
printf("%6s %8s %8s %8s\n", "6단", "7단", "8단", "9단");
for (i = 1; i < 10; i++) {
for (j = 6; j < 10; j++) {
printf("%d*%d = %2d ", j, i, i*j);
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment