Last active
November 28, 2016 03:38
-
-
Save koluku/970069c892b123c1bae381e04338777f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Exercise 8-1b, factor.c | |
*/ | |
#include <stdio.h> | |
int main(void){ | |
int i, j; | |
int fa[8]; | |
for(i = 0; i < 8; i++) { | |
scanf("%d", &fa[i]); | |
} | |
int o=0; | |
for(i = 0; i < 8; i++) { | |
for(j = i+1; j < 8; j++) { | |
if(fa[j]%fa[i] == 0) { | |
printf("%d %d\n", fa[i], fa[j]); | |
o++; | |
} | |
else if(fa[i]%fa[j] == 0) { | |
printf("%d %d\n", fa[i], fa[j]); | |
o++; | |
} | |
} | |
} | |
if(o == 0) { | |
printf("none.\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment