题目内容
运行以下程序,输入2 10,写出程序运行结果。#include #include int fun(int m);int main(){int count, i, m, n, sum;int prime(int m);scanf("%d%d", &m, &n);count = sum = 0;for(i = m; i <= n; i++)if(fun(i) != 0){count++;sum = sum + i;}printf("%d#%d\n", count, sum);}int fun(int m){int k, i;if(m == 1) return 0;k = sqrt(m);for(i = 2; i <= k; i++)if(m % i == 0) return 0;return 1;}
查看答案
搜索结果不匹配?点我反馈
更多问题