Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(int argc, char **argv) {
- int broj, nzd, br=1, i, n;
- printf("n = ");
- scanf("%d", &n);
- printf("1. broj = ");
- scanf("%d", &broj);
- nzd=broj;
- while (n>1) {
- br++;
- printf("%d. broj = ", br);
- scanf("%d", &broj);
- for (i=nzd; i>=1; i--)
- if ((broj%i==0)&&(nzd%i==0)) {
- nzd=i;
- break;
- }
- n--;
- }
- printf("nzd je %d", nzd);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement