标签:java while names highlight namespace else cin void ++
1
2
3
4
5
6
7
8
9
10
|
void prim( int m, int n) { if (m >= n) { while ( ) n++; ( ); prim(m, n); cout << n << endl; } } |
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int n;
printf("请输入一个大于0的整数:");
cin >> n;
printf("分解结果:");
for (int i =2; i <= n; i++)
{
while (n>=i)
{
if(n%i==0)
{
if (n == i)
{
printf("%d", i);
n = n / i;
}
else
{
printf("%d*", i);
n = n / i;
}
}
else
{
break;
}
}
}
return 0;
}
标签:java while names highlight namespace else cin void ++
原文地址:http://www.cnblogs.com/fenglongyu/p/7625657.html