[恢]hdu 1405
2012-01-06 22:45
169 查看
2011-12-20 05:26:53
地址:http://acm.hdu.edu.cn/showproblem.php?pid=1405
题意:分解素因子。
mark:PE2次。每行最后有一个空格。太无聊了- -。
代码:
地址:http://acm.hdu.edu.cn/showproblem.php?pid=1405
题意:分解素因子。
mark:PE2次。每行最后有一个空格。太无聊了- -。
代码:
# include <stdio.h> void output(int n) { int i, cnt ; for (i = 2 ; n != 1 ; i++) { if (n%i==0) { cnt = 0 ; while (n%i==0){cnt++; n/=i;} printf ("%d %d ", i, cnt) ; } } printf ("\n") ; } int main () { int n, nCase = 1; while (~scanf ("%d", &n) && n >= 2) { if (nCase != 1) printf ("\n") ; printf ("Case %d.\n", nCase++) ; output(n) ; } return 0 ; }
相关文章推荐
- HDU 1405 The Last Practice - 解题心得
- hdu 1405 The Last Practice 输出格式需注意
- hdu 1405 The Last Practice (数学)
- HDU 1405 The Last Practice(求质因子及其个数 )
- HDU 1405 The Last Practice 数学水题
- HDU 1405 The Last Practice 数学水题
- HDU 1405 The Last Practice
- HDU 1405 The Last Practice(暴力枚举)
- HDU 1405 The Last Practice(数学题,变态的格式)
- hdu 1405
- hdu_1405 The Last Practice
- hdu 1405 The Last Practice(数论:欧拉函数的变形)
- HDU 1405 The Last Practice
- hdu-oj 1405 The Last Practice
- hdu1405 The Last Practice
- hdu1405 第六周J题(质因数分解)
- HDU 1405
- HDU 1405 The Last Practice
- HDU1405-素数筛选
- HDU 1405