当前位置:网站首页>聪明人的游戏提高篇:第三章第二课:“桐桐数”(number)
聪明人的游戏提高篇:第三章第二课:“桐桐数”(number)
2022-08-02 05:12:00 【闪耀的天狼星】
#include <iostream>
#include <cstdio>
using namespace std;
long long n,i,j,s=2;
int t(int a)
{
for (j=2;j*j<=a;j++)
if (a%j==0)
return 0;
if (a>1)
return 1;
return 0;
}
int main()
{
cin >>n;
for (i=2;i*i<=n;i++)
if (n%i==0)
s+=2;
i--;
if (i*i==n && !t(i))
s--;
if (s==4)
cout <<"It's a Tongtong number.";
else
cout <<"It's not a Tongtong number.";
return 0;
}
边栏推荐
- 分布式文件存储服务器之Minio对象存储技术参考指南
- Features and installation of non-relational database MongoDB
- C 竞赛——捕鱼
- golang's time package: methods for time interval formatting and output of timestamp formats such as seconds, milliseconds, and nanoseconds
- 18 years of programmer career, read more than 200 programming books, pick out some essence to share with you
- Google 安装印象笔记剪藏插件
- ERROR 1045 (28000) Access denied for user 'root'@'localhost'Solution
- Install and use Google Chrome
- nacos注册中心
- 25K测试老鸟6年经验的面试心得,四种公司、四种问题…
猜你喜欢
C语言中i++和++i在循环中的差异性
51 MCU peripherals: ADC
apisix-入门使用篇
There are more and more talents in software testing. Why are people still reluctant to take the road of software testing?
eggjs controller层调用controller层解决方案
深度学习——CNN实现MNIST手写数字的识别
Detailed explanation of interface in Go language
21 Day Learning Challenge Schedule
[C language] LeetCode26. Delete duplicates in an ordered array && LeetCode88. Merge two ordered arrays
面试官:设计“抖音”直播功能测试用例吧
随机推荐
nacos注册中心
OAuth 授权协议 | 都云原生时代了,我们应该多懂一点OAuth ?
Automated operation and maintenance tools - ansible, overview, installation, module introduction
Say good woman programmers do testing have an advantage?More than a dozen interview, abuse of cry ~ ~ by the interviewer
复盘:图像饱和度计算公式和图像信噪(PSNR)比计算公式
整合ssm(一)
golang的time包:时间间隔格式化和秒、毫秒、纳秒等时间戳格式输出的方法
5年在职经验之谈:2年功能测试、3年自动化测试,从入门到不可自拔...
LeetCode刷题系列 -- 10. 正则表达式匹配
测试环境要多少?从成本与效率说起
Point Density-Aware Voxels for LiDAR 3D Object Detection 论文笔记
自动化运维工具——ansible、概述、安装、模块介绍
Linux CentOS8安装Redis6
浏览器的onload事件
【C语言】LeetCode26.删除有序数组中的重复项&&LeetCode88.合并两个有序数组
APP Bluetooth connection test of test technology
How much does a test environment cost? Start with cost and efficiency
非关系型数据库MongoDB的特点及安装
[PSQL] window function, GROUPING operator
跨桌面端Web容器演进