#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std ;
int Euler(int n)
{
int rea = n ;
for(int i = 2;i*i <= n;i++)
{
if(n%i == 0)
rea -= rea/i ;
while(n%i == 0)
n/=i ;
}
if(n>1)
rea-=rea/n ;
return rea ;
}
int main()
{
int T ;
int n ;
scanf("%d" ,&T) ;
while(T--)
{
scanf("%d" , &n) ;
printf("%d\n" ,Euler(n)) ;
}
return 0 ;
}
时间: 2024-10-06 06:39:09