Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int funkc(int x) {
- if(x==0)
- {
- return 1;
- }
- int br=0;
- int cifra=x%10;
- for(int i=1;i<=cifra;i++) {
- if (cifra%i==0) {
- br++;
- }
- }
- if(br==2){
- return funkc(x/10)*cifra;
- }
- else {
- return funkc(x/10);
- }
- }
- int main() {
- int x;
- cin>>x;
- cout<<funkc(x)<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement