Fractions Again?! UVA
来源:互联网 发布:直通网络测试仪怎么用 编辑:程序博客网 时间:2024/06/15 08:20
问题类型:暴力枚举,分数
问题链接
03pie’s solution for [UVA-10976] :
#include<bits/stdc++.h>//包含所有头文件using namespace std;typedef long long LL;const double PI=acos(-1.0);const int maxn=10000+5;int a[maxn],b[maxn];int main(){ freopen("F://inp.txt","r",stdin); freopen("F://outp.txt","w",stdout); int n; while(~scanf("%d",&n)){ int k=n<<1,count=0; for(int i=n+1;i<=k;i++){ if(n*i%(i-n)==0){ a[count]=n*i/(i-n),b[count]=i; count++; } } printf("%d\n",count); for (int i = 0 ; i < count ; ++ i) printf("1/%d = 1/%d + 1/%d\n",n,a[i],b[i]); } return 0;}
0 0
- UVA 10976 - Fractions Again?!
- UVA 10976 - Fractions Again?!
- UVA-10976 - Fractions Again?!
- UVA - 10976 Fractions Again?!
- UVa 10976 - Fractions Again?!
- UVa 10976 - Fractions Again?!
- UVa 10976 - Fractions Again?!
- UVA - 10976 Fractions Again?!
- uva 10976 - Fractions Again?!
- UVa 10976 Fractions Again?!
- Uva - 10976 - Fractions Again?!
- UVA - 10976 Fractions Again?!
- uva 10976Fractions Again?!
- UVA 10976 - Fractions Again?!
- UVA 10976 Fractions Again?!
- UVA 10976 Fractions Again?!
- UVa 10976 Fractions Again?
- UVa 10976 Fractions Again?!
- eclipse中修改的文件如何在不重启tomcat(或清缓存)的情况下自动更新到tomcat
- String与StringBuffer的区别
- mysql中的知识点二
- 深入理解 Android 卷I
- ERROR:language "plpgsql" does not exist
- Fractions Again?! UVA
- 欢迎使用CSDN-markdown编辑器
- linux时间同步服务NTP安装配置教程
- xfire 开发实例
- 欢迎使用CSDN-markdown编辑器
- mib文件的编写
- YII2.0框架(四) 数据库操作yii\db\Commond
- 深度学习Matlab工具箱代码注释——cnntrain.m
- react+wepack入门(1)