当前位置:网站首页>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;
}边栏推荐
- 双重for循环案例(用js打印九九乘法表)
- navicat connects to MySQL and reports an error: 1045 - Access denied for user 'root'@'localhost' (using password YES)
- 51单片机外设篇:点阵式LCD
- Features and installation of non-relational database MongoDB
- Meta公司内部项目-RaptorX:将Presto性能提升10倍
- Automated operation and maintenance tools - ansible, overview, installation, module introduction
- 服务器的单机防御与集群防御
- 复盘:图像饱和度计算公式和图像信噪(PSNR)比计算公式
- coredns介绍
- apisix-Getting Started
猜你喜欢

Detailed explanation of the software testing process (mind map) of the first-tier manufacturers

双重for循环案例(用js打印九九乘法表)

Linux CentOS8安装Redis6

虚拟现实房产展示系统提前预见未来装修效果

ERROR 1045 (28000) Access denied for user 'root'@'localhost'Solution

leetcode一步解决链表合并问题

eggjs controller层调用controller层解决方案

Redis-集群模式(主从复制模式,哨兵模式,集群化模式)

Introduction to Grid Layout

Redis-cluster mode (master-slave replication mode, sentinel mode, clustering mode)
随机推荐
51单片机外设篇:DS18B20
Mysql implements optimistic locking
Shuttle + Alluxio 加速内存Shuffle起飞
关于鸿蒙系统 JS UI 框架源码的分析
Review: image saturation calculation formula and image signal-to-noise (PSNR) ratio calculation formula
Go language study notes - grpc serverclient protobuf Go language from scratch
测试技术之APP蓝牙连接测试
提高软件测试能力的方法有哪些?看完这篇文章让你提升一个档次
Google notes cut hidden plug-in installation impression
国际顶会OSDI首度收录淘宝系统论文,端云协同智能获大会主旨演讲推荐
测试环境要多少?从成本与效率说起
eggjs controller层调用controller层解决方案
Install and use Google Chrome
国际顶会OSDI首度收录淘宝系统论文,端云协同智能获大会主旨演讲推荐
关于web应用的目录结构
el-input can only input integers (including positive numbers, negative numbers, 0) or only integers (including positive numbers, negative numbers, 0) and decimals
apisix-Getting Started
25K测试老鸟6年经验的面试心得,四种公司、四种问题…
Alluxio为Presto赋能跨云的自助服务能力
pytorch常用函数