您的位置:首页 > 其它

poj2407

2016-02-01 11:00 183 查看
#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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: