计算素数、平方数、乘积等特殊的数字,怎么用C语言的程序代码编写思想的方法来实现程序的编写的

Problem Description
Numbers are interesting, but some are inherently more interesting than others, by various criteria. Given a collection of numbers, you are to find the
most interesting ones.

A number X is more interesting than another number Y if it has more attributes than Y. For the purposes of this problem, the attributes that are
interesting are:

Note that 0 has no multiples other than itself, and 1 is not prime.

In addition to the above attributes, there are also those which depend on the other numbers in a given collection:

This makes for a total of thirteen possible attributes. Note that meeting the criteria for a particular attribute in multiple ways (1 is the factor of all
other numbers, for example) still only counts as a single instance of an attribute.

Given a collection of numbers, you are to determine which numbers in that collection are most interesting.

Input
Input to this problem will begin with a line containing a single integer N (1 ≤ N ≤ 100) indicating the number of data sets. Each data set consists of
the following components:

A line containing a single integer M (1 ≤ M ≤ 100) indicating how many numbers are in the collection;
A series of M lines, each with a single integer X (1 ≤ X ≤ 1000000). There will be no duplicate integers X within the same data set.

Output
For each data set in the input, output the heading "DATA SET #k" where k is 1 for the first data set, 2 for the second, and so on. For each data set,
print the number or numbers that are most interesting in the collection. If more than one number ties for "most interesting," print them in ascending
order, one to a line.

Sample Input
2
2
1
100
3
2
3
4

Sample Output
DATA SET #1
1
DATA SET #2
4

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问

相似问题

3
用c语言实现素数的判定方法
3
javascrrpt怎么计算100以内所有素数的值,用log打印输出
1
如何用c语言编写这个程序?
0
关于C语言的一个入门小程序的问题!求解答!可有偿!!!!
1
用c语言编程,用筛选法求2到100之间的素数
3
两个数,求两个数之间素数的个数,数据非常大。
2
c语言编程题目: 回文素数(望解答)
2
2019第一个问题,请问用C语言怎么实现素数的这个算法?
1
给定一个区间以内,求其中素数的个数,采用C语言方式的实现
0
质数分解二叉树的一个问题,数据结构问题怎么采用C语言的实现
0
请问这个使用C语言计算最大的质数因数的算法问题的解答的方式怎么实现?
2
一个素数的问题,但是求的是素数的个数,怎么利用C语言的办法解决的
1
素数的队列的计算问题的算法,采用C语言的编程计算实现它
1
先判断是否是质数然后统计个数的问题怎么利用C语言程序写的办法来实现
3
请问C语言中多余的空行是怎么回事呀?是编译器的问题吗?
0
素数的判断,多个数字连续的输入后的判断怎么利用C语言的办法来编写的
1
通过计算的判断究竟在范围内有多少个质数的问题,怎么使用C语言的程序的编写的技术实现?
0
给你一个整数区间[a,b],请你求出该区间的x使g(x)最大,此问题用C语言的程序代码怎么来计算的?
0
伪素数的寻找算法的问题,怎么采用C语言的程序代码的编写的过程实现呢?
0
判断一个数字是否是伪素数的程序的编写,怎么使用的C语言的程序编写的办法来设计一个程序去实现的