用c语言,设一个等差数列,首元素为368,公差为187, 现在要求找出属于该等差数列中的第154个素数并输出。

日期:2022-02-26 16:49:38 人气:1

用c语言,设一个等差数列,首元素为368,公差为187, 现在要求找出属于该等差数列中的第154个素数并输出。

#include<stdio.h>
#include<math.h>
int main() {
int start = 368;
int diff = 187;
// 判断输入的数值,是否是素数
int isPrime(int digit) {
int sq = sqrt(digit);
    A+
热门评论