C实验报告模板C实报告模板.docVIP

  • 10
  • 0
  • 约2.78千字
  • 约 10页
  • 2017-01-09 发布于贵州
  • 举报
C实验报告模板C实报告模板

一.实验目的 5)求100~230 之间所有素数的和。 6 输入某学生成绩,若成绩在90-100 输出"excellent",若成绩在80-89 输出"good",若成绩在70-79 输出"general",若成绩在60-69 输出”pass”,若成绩在0-59 输出”no pass”。 7) 编程计算n!。n 从键盘输入,且n=15。 8) 编程计算1!+2!+……+20! 二.实验软件环境 Microsoft Visual Studio 2010 三.实验内容 第5题 #include stdio.h #include math.h int main () { int n,m,i,sum=0; for(n=101;n=230;n+=2) { m=(n/2); for (i=2;i=m;i++) if (n%i==0) break; if (i=m+1) { sum+=n; } } printf(the result is: %d\n,sum); return 0; } 第6题 #include stdio.h #include math.h int main () { unsigned score; printf(Please Enter the score of a

文档评论(0)

1亿VIP精品文档

相关文档