hdu1405 The Last Practice
来源:互联网 发布:网络语蜡烛什么意思 编辑:程序博客网 时间:2024/05/17 02:51
/*
水题,输出有点坑,输出的最后是有一个空格的
*/
#include<iostream>#include<cmath>#define Max 65535using namespace std;int pr[Max/2+5], dp[Max+1];void ss(){memset(dp, 0, sizeof(dp));int i, j;for( i=2; i <= Max/2 ; i++ ){for( j=i+i; j <= Max; j+=i )dp[j] = 1;}for( i=2, j=0; i <= Max; i++){if(dp[i] == 0)pr[j++] = i;}}int main(){int n, T=1;ss();bool p = false;while(scanf("%d", &n) != EOF && n >= 0){if(p)printf("\n");p =true;printf("Case %d.\n", T++);int i=0, m=0;bool pp = false;while(1){if(n%pr[i] == 0)m++, n /= pr[i];else{if(m){//if(pp)//printf(" ");//pp = true;printf("%d %d ", pr[i], m);}i++;m=0;if(n/pr[i] == 0)break;}}printf("\n");}return 0;}
- HDU1405:The Last Practice
- HDU1405 The Last Practice
- hdu1405 The Last Practice
- hdu1405 The Last Practice
- HDU1405 The Last Practice
- The Last Practice(HDU1405)
- hdu1405——The Last Practice
- hdu_1405 The Last Practice
- The Last Practice
- The Last Practice
- HDU The Last Practice
- hd1405 The Last Practice
- hdu 1405 The Last Practice
- The Last Practice hdu 1405
- HDU 1405 The Last Practice
- 【HDOJ】1405 -> The Last Practice
- HDU 1405The Last Practice
- 杭电-The Last Practice
- log4j.appender.file.DatePattern的含义
- (转)Android深入浅出之Binder机制
- log4j配置祥解
- Html.CheckBox
- 1.3
- hdu1405 The Last Practice
- log4j - 指定log文件名 动态生成Log文件
- 自动下载百度音乐的脚本
- 图解win2003下apache+php+mysql+phpmyadmin+Zend Optimizer
- Dark Side of Cloud Storage:多副本 vs. 主从
- Athena Framework简介
- VS 2010 Ribbon
- 我的博客园地址:http://www.cnblogs.com/lvking/
- 函数指针