当前位置:网站首页>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;
}边栏推荐
- Detailed explanation of interface in Go language
- Navicat new database
- Shuttle + Alluxio 加速内存Shuffle起飞
- Detailed explanation of the software testing process (mind map) of the first-tier manufacturers
- Automated operation and maintenance tools - ansible, overview, installation, module introduction
- apisix-Getting Started
- APP Bluetooth connection test of test technology
- 自动化运维工具——ansible、概述、安装、模块介绍
- Integrate ssm (1)
- Redis数据库
猜你喜欢
随机推荐
51单片机外设篇:红外通信
回文串求解的进阶方法
洛谷小游戏大全(用洛谷的人都得知道)
Automated operation and maintenance tools - ansible, overview, installation, module introduction
leetcode每天5题-Day04
Alluxio为Presto赋能跨云的自助服务能力
Introduction and use of apifox (1).
【C语言】LeetCode26.删除有序数组中的重复项&&LeetCode88.合并两个有序数组
Introduction to coredns
Redis-集群模式(主从复制模式,哨兵模式,集群化模式)
关于 VS Code 优化启动性能的实践
navicat connects to MySQL and reports an error: 1045 - Access denied for user 'root'@'localhost' (using password YES)
Redis集群模式
如何进行并发数计算(稳定性测试和压力测试)?
配合蓝牙打印的encoding-indexes.js文件内容:
机器学习——支持向量机原理
pytorch常用函数
分布式文件存储服务器之Minio对象存储技术参考指南
软件测试的需求人才越来越多,为什么大家还是不太愿意走软件测试的道路?
C语言基础知识梳理总结:零基础入门请看这一篇








