hdu1405
来源:互联网 发布:怎么设计淘宝首页 编辑:程序博客网 时间:2024/05/17 02:28
这题太坑,容易理解 但形式我错了很多次,,,,,,
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
int n;
int a[100];
int b[100];
int h = 0;
int flag= 0;
while(cin >> n)
{
flag++;
if(n<0)break;
else
{
if(flag!=1)
cout<<endl;
cout<<"Case "<<flag<<"."<<endl;
}
if(n==0||n==1)continue;
memset(a, 0, sizeof(a));
int k= 0;
for(int i = 2; i <= n; i++)
{
if(n%i==0)
k++;
while(n%i==0)
{
a[k]++;
b[k] = i;
n /= i;
}
if(n/i==0)
break;
}
//cout << "Case "<< h <<"."<< endl;
for(int i = 1; i <= k; i++)
cout << b[i] << " "<< a[i] <<" ";
cout << endl;
}
}
- hdu1405
- hdu1405
- hdu1405
- HDU1405
- HDU1405:The Last Practice
- HDU1405 The Last Practice
- hdu1405 The Last Practice
- hdu1405 The Last Practice
- HDU1405-素数筛选
- HDU1405 The Last Practice
- hdu1405 后置0的个数
- The Last Practice(HDU1405)
- hdu1405——The Last Practice
- UITableView实例详解
- 项目中多线程的使用
- java虚拟机常用命令工具
- Android 利用ViewPager、Fragment、PagerTabStrip实现多页面滑动效果
- 借鉴的学习计划
- hdu1405
- C风格字符串(C—style character string)
- PHP_带smtp验证的发邮件函数
- C#中char数组转化为string
- FPGA开发之--Verilog中的位移指令
- android系统服务 adbd服务的开启
- CentOS5.5中文乱码以及中文输入法问题
- jQuery练习
- 归并排序对链表操作