求1000以内特定素数序列个数及平均值与数组移位操作实验报告.pdfVIP

  • 0
  • 0
  • 约小于1千字
  • 约 2页
  • 2026-05-28 发布于北京
  • 举报

求1000以内特定素数序列个数及平均值与数组移位操作实验报告.pdf

1,找出所有1000以内(含1000)满足I,

I+4,I+10都是素数的整数I(I+10也是在

1000以内)的个数cnt,以及这些I的平均

数AVG。

提示:判断是否是素数使用函数实现。

2,初始化一个有十个整数的整形数组,要求

从键盘上输入一个数值num(num10),整个

数组向前移动num位;

任选其一写成实验报告,下周四之前交到作

业平台。

1,FindthecountofintegersI(whereI,I+4,

I+10areallprimenumbers)withinthe

rangeuptoandincluding1000(I+10isalso

within1000),andcalculatetheaverageAVG

oftheseIvalues.

Hint:Useafunctiontodetermineifanumberis

prime.

2,Initializeanintegerarraywithtenelements.

Inputavaluenum(num10)fromthekeyboard,

andshifttheentirearrayforwardbynum

positions;

Chooseoneofthetasksandwriteitupasalabreport,

文档评论(0)

1亿VIP精品文档

相关文档