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/sum443 yes 48 11 4.3636use functions isprime(n),getsum(n),and get getmultiplication(n)
问题描述:
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)
答
#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;...