Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- #include <math.h>
- int funkcija(int broj) {
- int deliteli = 0;
- for(int i = 1; i <= broj; i++) {
- if(broj % i == 0) {
- deliteli++;
- }
- }
- if(deliteli > 2) {
- return -1;
- }
- else {
- return 1;
- }
- }
- int main(int argc, char * argv[]) {
- int x;
- scanf("%d", &x);
- int p = funkcija(x);
- printf("%d\n", p);
- }
Advertisement
Add Comment
Please, Sign In to add comment