👤

Doar problema 22 va roog!! DAU COROANA

Doar Problema 22 Va Roog DAU COROANA class=

Răspuns :

Răspuns:

#include <iostream>

#include <fstream>

using namespace std;

int main()

{

ofstream out("numere.out");

   int n,k,d;

   cin>>n;

   for(int i=1;i<=n;i++){ cin>>k;

     for(d=2;d<=k/2;d++)

         if(k%d==0) out<<k<<" ";

}

out.close();

   return 0;

}

Explicație: