当前位置:网站首页>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
边栏推荐
- Contract quantification system development (construction explanation) - contract quantification system development (source code analysis and ready-made cases)
- Deployment and optimization of vsftpd service
- day39 原型鏈及頁面烟花效果 2021.10.13
- Introduction to GDB
- 如临现场的视觉感染力,NBA决赛直播还能这样看?
- Day33 JS note event (Part 2) September 28, 2021
- SQL必需掌握的100个重要知识点:检索数据
- NFT卡牌链游系统开发dapp搭建技术详情
- day30 js笔记 BOM和DOM 2021.09.24
- Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
猜你喜欢

智联招聘基于 Nebula Graph 的推荐实践分享

String & heap & method area

Cannot redeclare block range variables

For example, the visual appeal of the live broadcast of NBA Finals can be seen like this?

QML控件类型:TabBar

太阳能无线LED显示屏的特点

Fruit FL studio/cubase/studio one music host software comparison

Deployment and optimization of vsftpd service

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

Day33 JS note event (Part 2) September 28, 2021
随机推荐
Zero foundation self-study SQL course | if function
The default point of this in JS and how to modify it to 2021.11.09
day24 js笔记 2021.09.15
Solutions to connection failures and errors when accessing mysql8 using the SSM project
It is safer for individuals to choose which securities company to open an account for buying floor funds
随机森林以及 AMR 训练出的诗词制造器
Day34 JS notes regular expression 2021.09.29
Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
Oracle date format exception: invalid number
This Exception was thrown from a job compiled with Burst, which has limited exception support. 报错
GCC introduction
董宇辉,新东方以及凤凰卫视
行业分析| 快对讲,楼宇对讲
科研丨Web of Science检索技巧
2022 open source software security status report: over 41% of enterprises do not have enough confidence in open source security
2022中国信通院首届业务与应用安全发展论坛成功召开!
Database Series: is there any way to seamlessly upgrade the business tables of the database
Day33 JS note event (Part 2) September 28, 2021
Recommended practice sharing of Zhilian recruitment based on Nebula graph
Class pattern and syntax in JS 2021.11.10