当前位置:网站首页>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 MCU peripherals: ADC
- 淘系资深工程师整理的300+项学习资源清单(2021最新版)
- Automated operation and maintenance tools - ansible, overview, installation, module introduction
- C语言小游戏——扫雷小游戏
- OAuth 授权协议 | 都云原生时代了,我们应该多懂一点OAuth ?
- Introduction and use of apifox (1).
- kubernetes 亲和、反亲和、污点、容忍
- 5年在职经验之谈:2年功能测试、3年自动化测试,从入门到不可自拔...
- JUC(一)- JUC学习概览 - 对JUC有一个整体的认识
猜你喜欢
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
线程基础(一)
[PSQL] 窗口函数、GROUPING运算符
APP Bluetooth connection test of test technology
深度学习——CNN实现MNIST手写数字的识别
Say good woman programmers do testing have an advantage?More than a dozen interview, abuse of cry ~ ~ by the interviewer
Point Density-Aware Voxels for LiDAR 3D Object Detection 论文笔记
无代码生产新模式探索
对node工程进行压力测试与性能分析
pytorch基本操作:使用神经网络进行分类任务
随机推荐
机器学习——支持向量机原理
ERROR 1045 (28000) Access denied for user 'root'@'localhost'Solution
BGP实验(路由反射器,联邦,路由优化)
Redis集群模式
线程基础(一)
51 MCU peripherals: DS18B20
leetcode每天5题-Day04
聪明人的游戏提高篇:第三章第二课:“桐桐数”(number)
JUC(二)原子类:CAS、乐观锁、Unsafe和原子类
leetcode 204. Count Primes 计数质数 (Easy)
虚拟现实房产展示系统提前预见未来装修效果
关于 VS Code 优化启动性能的实践
APP Bluetooth connection test of test technology
Three methods of importing sql files in MySQL
【C语言】LeetCode26.删除有序数组中的重复项&&LeetCode88.合并两个有序数组
The Go language learning notes - dealing with timeout - use the language from scratch from Context
无代码生产新模式探索
51单片机外设篇:DS18B20
C语言小游戏——扫雷小游戏
swinIR论文阅读笔记