Sgu 102. Coprimes
来源:互联网 发布:数据检索 编辑:程序博客网 时间:2024/05/01 19:08
gcd,暴力枚举
#include<stdio.h>int gcd(int a,int b){if(a<b)return gcd(b,a);if(b==0)return a;return gcd(b,a%b);}int main(){int n;while(scanf("%d",&n)!=EOF&&n){int i,res=0;for(i=1;i<=n;i++)if(gcd(n,i)==1)res++;printf("%d\n",res);}return 0;}
- [SGU]102. Coprimes
- Sgu 102. Coprimes
- SGU 102. Coprimes
- 【SGU】102. Coprimes 欧拉函数
- sgu 102 Coprimes 互质
- SGU 102 - Coprimes(简单)
- SGU 102(Coprimes)
- 102. Coprimes
- [SGU 102] Coprimes [欧拉函数]
- sgu-102 Coprimes 暴力GCD直接求解
- SGU - 102 - Coprimes (简单数论!)
- SGU 102 Coprimes(欧拉函数)
- Coprimes
- SGU 102 Coprimes ---- 欧拉函数、素数的应用&&GCD水题
- SGU102 Coprimes
- sgu102:Coprimes
- SGU102 Coprimes
- SGU102 Coprimes
- 应用系统单点登录系统开发文档
- RedHat linux下安装WebSphere7中文乱码解决方法
- 精益软件度量——实践者的观察与思考
- Java基本类型与byte数组之间相互转换
- 微软面试题[1-2]
- Sgu 102. Coprimes
- Linux SVN 服务器配置以及客户端使用
- LA 3942 Remember the Word
- SSO单点登录系统WEB Service代码
- sql+datagridview 更新数据库
- 问题四十七: 有等式[※×(※3+※)]2=8※※9,其中※处为1个数字,滴上了墨水无法辨认
- 向国外投稿需要注意些下面几点
- 【Unity3D插件】NGUI屏幕自适应
- C# WebSocket 聊天室