Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int n;
- scanf("%d", &n);
- int niza[n];
- for(int i = 0; i < n; i++) {
- scanf("%d", &niza[i]);
- }
- printf("Broevite ");
- for(int i = 0; i < n; i++) {
- int broj_na_deliteli = 0;
- for(int j = 1; j <= niza[i]; j++) {
- if(niza[i] % j == 0) {
- broj_na_deliteli++;
- }
- }
- if(broj_na_deliteli <= 2) {
- printf("%d ", niza[i]);
- }
- }
- printf(" se PROSTI\n");
- printf("Slozheni broevi se: ");
- for(int i = 0; i < n; i++) {
- int broj_na_deliteli = 0;
- for(int j = 1; j <= niza[i]; j++) {
- if(niza[i] % j == 0) {
- broj_na_deliteli++;
- }
- }
- if(broj_na_deliteli > 2) {
- printf("%d ", niza[i]);
- }
- }
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement