当前位置:网站首页>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;
}边栏推荐
- Point Density-Aware Voxels for LiDAR 3D Object Detection 论文笔记
- PIL与numpy格式之间的转换
- Detailed explanation of interface in Go language
- pytorch常用函数
- 为什么4个字节的float要比8个字节的long大呢?
- 如何优化OpenSumi终端性能?
- 区块元素、内联元素(<div>元素、span元素)
- Packaging and deployment of go projects
- 配合蓝牙打印的encoding-indexes.js文件内容:
- Redis-cluster mode (master-slave replication mode, sentinel mode, clustering mode)
猜你喜欢

程序员写PPT的小技巧

The Go language learning notes - dealing with timeout - use the language from scratch from Context

Block elements, inline elements (
elements, span elements)
C语言中i++和++i在循环中的差异性

线程基础(一)

51单片机外设篇:点阵式LCD

国际顶会OSDI首度收录淘宝系统论文,端云协同智能获大会主旨演讲推荐

驱动页面性能优化的3个有效策略
![[C language] LeetCode26. Delete duplicates in an ordered array && LeetCode88. Merge two ordered arrays](/img/eb/9b05508e88b7f17d80de2afa8c08ce.png)
[C language] LeetCode26. Delete duplicates in an ordered array && LeetCode88. Merge two ordered arrays

为什么4个字节的float要比8个字节的long大呢?
随机推荐
51 MCU Peripherals: Infrared Communication
nacos registry
深度学习——CNN实现MNIST手写数字的识别
Redis集群模式
Detailed installation and configuration of golang environment
关于鸿蒙系统 JS UI 框架源码的分析
JUC(二)原子类:CAS、乐观锁、Unsafe和原子类
51 microcontroller peripherals article: dot-matrix LCD
classSR论文阅读笔记
Shuttle + Alluxio 加速内存Shuffle起飞
About the directory structure of the web application
目标检测重要概念——IOU、感受野、空洞卷积、mAP
pytorch基本操作:使用神经网络进行分类任务
Timing task library in the language use Cron, rounding
JUC(一)- JUC学习概览 - 对JUC有一个整体的认识
Redis-----非关系数据库
pytorch常用函数
LeetCode brush topic series - 787 K station transfer within the cheapest flight
How much does a test environment cost? Start with cost and efficiency
21 Day Learning Challenge Schedule