当前位置:网站首页>4. maximum continuity factor
4. maximum continuity factor
2022-06-28 11:46:00 【HBUcs2020】
#include<iostream>
using namespace std;
#include<cmath>
int isprime(int x)
{
for(int i=2;i<=sqrt(x);i++)
{
if(x%i==0) // Note that it is residual
return 0;
}
return 1;
}
int main()
{
int n;
cin>>n;
if(isprime(n))
{
cout<<"2"<<endl<<"1*"<<n<<endl;
}
else
{
int cout=0; // Number
int start=0; // The starting position
int m_cout=0; // Maximum
for(int i=2;i<=sqrt(n);i++)
{
cout=0;
int t=n;
int j=i;
while(t%j==0)
{
t=t/j;
j++;
cout++;
}
if(cout>m_cout)
{
start=i;
m_cout=cout;
}
}
cout<<m_cout<<endl;
for(int i=start;i<start+m_cout;i++)
{
if(i==start)
printf("%d",i);
else
printf("*%d",i);
}
}
return 0;
}
But there is one doubt
error: invalid operands of types ‘int’ and ‘<unresolved overloaded function type>’ to binary ‘operator<<’
cout<<m_cout<<endl;Chinese is : For binary 'operator<<' Of 'int' and '< Unresolved overloaded function types >' Invalid operand of type
Change it to printf That's right
边栏推荐
- recent developments
- The development and principle of the metacosmic system
- Contract quantitative trading system development | contract quantitative app development (ready-made cases)
- Fruit FL studio/cubase/studio one music host software comparison
- Day37 JS note motion function 2021.10.11
- 《运营之光3.0》全新上市——跨越时代,自我颠覆的诚意之作!
- Class pattern and syntax in JS 2021.11.10
- day28 严格模式、字符串 js 2021.09.22
- Ali three sides: what is the difference between using on or where in the left join associated table and the condition
- 买股票在中金证券经理的开户二维码上开户安全吗?求大神赐教
猜你喜欢
Day33 JS note event (Part 2) September 28, 2021
Ali three sides: what is the difference between using on or where in the left join associated table and the condition
Packaging and publishing application of jetpack compose desktop version
js中的class类模式及语法 2021.11.10
day36 js笔记 ECMA6语法 2021.10.09
Database Series: is there any way to seamlessly upgrade the business tables of the database
行业分析| 快对讲,楼宇对讲
Day37 JS note motion function 2021.10.11
携手Cigent:群联为SSD主控固件引入高级网络安全防护特性
无法重新声明块范围变量
随机推荐
GCC introduction
无法重新声明块范围变量
东方财富手机股票开户哪个券商更安全更方便?
Database Series: is there any way to seamlessly upgrade the business tables of the database
ProCAST finite element casting process simulation software
Day37 JS note motion function 2021.10.11
MySQL cannot query the maximum value using the max function
[sciter]: how sciter uses i18 to realize multi language switching of desktop applications and its advantages and disadvantages
使用logrotate对宝塔的网站日志进行自动切割
day29 js笔记 2021.09.23
For example, the visual appeal of the live broadcast of NBA Finals can be seen like this?
Characteristics of solar wireless LED display
Day23 JS notes 2021.09.14
Use logrotate to automatically cut the website logs of the pagoda
Thesis reading (59):keyword based diverse image retrieval with variable multiple instance graph
合约量化交易系统开发 | 合约量化APP开发(现成案例)
李宏毅《机器学习》丨7. Conclusion(总结)
Array method in JS 2021.09.18
[semidrive source code analysis] [x9 chip startup process] 32 - play module analysis - RTOS side
day39 原型链及页面烟花效果 2021.10.13