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; }
相关文章推荐
- 利用LoadRunner编写socket性能测试脚本
- 金融信息交换协议(FIX)v5.0读书笔记(0)
- 更新ADT到Android L的方法
- QT5的软键盘输入法实现
- mac系统如何显示和隐藏文件
- 锁
- 进度条的写法
- 博客园添加访问人数统计
- commonJS — 浏览器操作(for Browser)
- zz一个失败的复旦学生的奋斗生涯
- Android中SwipeBack实现右滑返回效果
- 移植opencv到龙芯1c上
- js数组和字符串去重复几种方法
- 【Linux学习009】脚本编程之变量、条件测试和条件判断
- python中的实例方法、静态方法、类方法、类变量和实例变量浅析
- SBT和Git 使用代理
- Nginx笔记
- 样本筛选与特征处理
- 域名与IP地址的联系与区别
- make源码包安装