当前位置:网站首页>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
边栏推荐
- MySQL cannot query the maximum value using the max function
- 水果FL Studio/Cubase/Studio one音乐宿主软件对比
- 赛尔号抽奖模拟求期望
- Characteristics of solar wireless LED display
- NFT卡牌链游系统开发dapp搭建技术详情
- 面试步骤的面试技巧
- 第2章 还记得点、线、面吗(二)
- Deployment and optimization of vsftpd service
- 工作组环境下的内网渗透:一些基础打法
- 100 important knowledge points that SQL must master: retrieving data
猜你喜欢

一套十万级TPS的IM综合消息系统的架构实践与思考

Training notice | special training notice on epidemic prevention and security prevention for overseas Chinese funded enterprises, institutions and personnel in 2022
This Exception was thrown from a job compiled with Burst, which has limited exception support. report errors

Oracle date format exception: invalid number

零基础自学SQL课程 | IF函数

Web page tips this site is unsafe solution

Making and using of dynamic library (shared library)

一套十万级TPS的IM综合消息系统的架构实践与思考

day39 原型鏈及頁面烟花效果 2021.10.13

2022中国信通院首届业务与应用安全发展论坛成功召开!
随机推荐
东方财富手机股票开户哪个券商更安全更方便?
Apache2配置对目录拒绝访问,但是可以访问里面文件的设置
Use logrotate to automatically cut the website logs of the pagoda
day36 js笔记 ECMA6语法 2021.10.09
Day37 JS note motion function 2021.10.11
JS foundation 10
mysql-.sql文件钓鱼上线
Recommended practice sharing of Zhilian recruitment based on Nebula graph
Industry analysis - quick intercom, building intercom
day32 js笔记 事件(上)2021.09.27
js中的数组方法 2021.09.18
行业分析| 快对讲,楼宇对讲
2022中国信通院首届业务与应用安全发展论坛成功召开!
关于Pytorch中双向LSTM的输出表示问题
Chapter 2 do you remember the point, line and surface (2)
《运营之光3.0》全新上市——跨越时代,自我颠覆的诚意之作!
Array method in JS 2021.09.18
Unity screenshot function
网页提示此站点不安全解决方案
Apache2 configuration denies access to the directory, but can access the settings of the files inside