#include <stdio.h> #include <stdlib.h> int prost(int n,int i) { if(i*i>n) { return 1; } if(n%i==0) { return 0; } prost(n,i+1); } int main() { int n; scanf("%d", &n); if(prost(n,2)) { printf("Prost"); } else { printf("Slozen"); } return 0; }
Learn To Write A Program. Learn Programming Online. Find Programming Solutions.
#include <stdio.h> #include <stdlib.h> int prost(int n,int i) { if(i*i>n) { return 1; } if(n%i==0) { return 0; } prost(n,i+1); } int main() { int n; scanf("%d", &n); if(prost(n,2)) { printf("Prost"); } else { printf("Slozen"); } return 0; }