C 语言 急
wirte a program that generates 100 randomly numbers (between 0 and 1000),shows is it prime or not,also reads the number digits,coputes multiplication(mulp) and sum of the computed digits,and divides mulp/sum.displays results as a table:
Num :prime:digits mulp :digits sum:mulp/sum
443 yes 48 11 4.3636
use functions isprime(n),getsum(n),and get getmultiplication(n)
人气:174 ℃ 时间:2020-05-31 04:10:43
解答
#include #include #include #include unsigned int getRandNumber(unsigned int min,unsigned int max){return rand()%(max-min)+min;} int isPrime(unsigned int n){int i,k=(int)sqrt(n);for(i=2;i1;...
推荐
猜你喜欢