Cod sursa(job #2248868)

Utilizator haila2Nume complet haila2 Data 29 septembrie 2018 13:42:13
Problema Divizori Primi Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.5 kb
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    ifstream f("divprim.in");
    ofstream g("divprim.out");
    int n,x,y,nr;
    f>>n;
    while(f>>x>>y)
    {
        nr=0;
        for(int d=2; d*d<x; d++)
            if(x%d==0)
            {
                nr++;
                while(x%d==0)
                    x/=d;
            }
        for(int i=0; i<100000; i++)
            if(nr==y && i<=x)
                cout<<i<<" ";
    }
    return 0;
}