#include<iostream>
#include<cmath>
//#define LL long long
typedef long long LL;
using namespace std;
int enlerFun(int n)
{
int count = n;
int i = 2;
for(; i<=n; i++)
if(n % i == 0)
{
count -= count / i;
while(n % i == 0)
n /= i;
}
return count;
}
int main(){
int inputVal = 0;
int count = 0;
while(scanf("%d", &inputVal) && inputVal != 0)
{
count = enlerFun(inputVal);
printf("%d\n", count);
}
return 0;
}
poj2407
最新推荐文章于 2019-05-07 12:18:00 发布