当前位置:网站首页>Smart people's game improvement: Chapter 3, Lesson 2: "Number of Tongtong" (number)
Smart people's game improvement: Chapter 3, Lesson 2: "Number of Tongtong" (number)
2022-08-02 06:32:00 【Shining Sirius】
#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;
}
边栏推荐
- 51单片机外设篇:ADC
- Mysql common commands
- apisix-Getting Started
- 腾讯大咖分享 | 腾讯Alluxio(DOP)在金融场景的落地与优化实践
- The original question on the two sides of the automatic test of the byte beating (arranged according to the recording) is real and effective 26
- CPU使用率和负载区别及分析
- 【OpenCV从入门到实践】图像处理技术[像素](全网最详细)
- 本周大新闻|苹果MR已进行Pre-EVT测试,Quest 2涨价100美元
- The Go language learning notes - dealing with timeout - use the language from scratch from Context
- Detailed installation and configuration of golang environment
猜你喜欢
Redis集群模式
深度学习——CNN实现MNIST手写数字的识别
apisix-Getting Started
ApiPost is really fragrant and powerful, it's time to throw away Postman and Swagger
无代码生产新模式探索
Introduction to coredns
Say good woman programmers do testing have an advantage?More than a dozen interview, abuse of cry ~ ~ by the interviewer
Redis-集群模式(主从复制模式,哨兵模式,集群化模式)
The company does not pay attention to software testing, and the new Ali P8 has written a test case writing specification for us
面试官:设计“抖音”直播功能测试用例吧
随机推荐
Difference and analysis of CPU usage and load
面试官:设计“抖音”直播功能测试用例吧
leetcode 204. Count Primes 计数质数 (Easy)
leetcode每天5题-Day04
Brush LeetCode topic series - 10. Regular expression match
Redis集群模式
kubernetes 亲和、反亲和、污点、容忍
Cyber Security Learning - Intranet Penetration 4
classSR论文阅读笔记
There are more and more talents in software testing. Why are people still reluctant to take the road of software testing?
机器学习——支持向量机原理
pytorch常用函数
软件测试的需求人才越来越多,为什么大家还是不太愿意走软件测试的道路?
Detailed installation and configuration of golang environment
MySql copies data from one table to another table
聪明人的游戏提高篇:第三章第二课:“桐桐数”(number)
[PSQL] 函数、谓词、CASE表达式、集合运算
goroutine (coroutine) in go language
51单片机外设篇:红外通信
PSQL function, predicate, CASE expression and set operations