当前位置:网站首页>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 论文笔记
- Review: image saturation calculation formula and image signal-to-noise (PSNR) ratio calculation formula
- 无代码生产新模式探索
- 面试官:设计“抖音”直播功能测试用例吧
- Introduction and use of apifox (1).
- 深度学习——CNN实现MNIST手写数字的识别
- Redis(十二) - Redis消息队列
- 51 MCU peripherals: DS18B20
- Redis集群模式
猜你喜欢
网安学习-内网渗透4
[PSQL] window function, GROUPING operator
区块元素、内联元素(<div>元素、span元素)
leetcode一步解决链表合并问题
Use the browser's local storage to realize the function of remembering the user name
Stress testing and performance analysis of node projects
Meta公司新探索 | 利用Alluxio数据缓存降低Presto延迟
分布式文件存储服务器之Minio对象存储技术参考指南
【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
25K测试老鸟6年经验的面试心得,四种公司、四种问题…
随机推荐
flex布局(弹性布局)
双重for循环案例(用js打印九九乘法表)
洛谷小游戏大全(用洛谷的人都得知道)
聪明人的游戏提高篇:第三章第二课:“桐桐数”(number)
51单片机外设篇:DS18B20
5款经典代码阅读器的使用方案对比
Shell 脚本不同玩法
Mysql implements optimistic locking
国际顶会OSDI首度收录淘宝系统论文,端云协同智能获大会主旨演讲推荐
eggjs controller层调用controller层解决方案
Differences between i++ and ++i in loops in C language
Alluxio为Presto赋能跨云的自助服务能力
MySql copies data from one table to another table
The Go language learning notes - dealing with timeout - use the language from scratch from Context
Redis database
BGP实验(路由反射器,联邦,路由优化)
Meta公司新探索 | 利用Alluxio数据缓存降低Presto延迟
国际顶会OSDI首度收录淘宝系统论文,端云协同智能获大会主旨演讲推荐
高防服务器防御的原理是什么
C竞赛训练