Pagini recente » Rating Preda Mihai (kana) | Borderou de evaluare (job #147261) | Cod sursa (job #351832) | Rating Vehuiah Vehuiah (Vehuiah) | Cod sursa (job #720468)
Cod sursa(job #720468)
#include<fstream>
using namespace std;
int n,k,suma,divizor;
void SumaDiv(int x)
{
int i;
divizor = 0;
for(i=1; i<=x; i++)
if(x % i == 0)
{
divizor++;
suma = suma + i;
}
}
void Rezolvare()
{
ifstream f("ssnd.in");
ofstream g("ssnd.out");
int i,x;
f >> k;
for(i=0; i<k; i++)
{
f >> x;
suma = 0;
SumaDiv(x);
g << divizor << " " << suma << "\n";
}
f.close();
g.close();
}
int main ()
{
Rezolvare();
return 0;
}