标签:
Description
Input
Output
Sample Input
Sample Output
#include<stdio.h>
int Oula(int n)
{
int sum=n,i;
for(i=2; i*i<=n; i++)
{
if(n%i==0)
{
n /= i;
sum /= i;
sum *= i-1;
while(n%i==0)
n /= i;
}
}
if(n>1)
{
sum /= n;
sum *= n-1;
}
return sum;
}
int main ()
{
int n, t;
scanf ("%d", &t);
while(t--)
{
scanf("%d", &n);
printf("%d\n", Oula(n));
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/yishilin/p/4237097.html