求大神快做这道程序题啊。
展开全部
unsigned int array[10];
main(){
for(int i=0;i<10;i++){
int random;
while(1){
if(if random = math.random()*10>=10&&random = math.random()*10<=50)return;
}
if(random%2==0){
array[i]=random;
printf("a[%d]=%d是偶数",i,random);
}
if(random%2!=0){
array[i]=random;
printf("a[%d]=%d是奇数",i,random);
}
}
}
main(){
for(int i=0;i<10;i++){
int random;
while(1){
if(if random = math.random()*10>=10&&random = math.random()*10<=50)return;
}
if(random%2==0){
array[i]=random;
printf("a[%d]=%d是偶数",i,random);
}
if(random%2!=0){
array[i]=random;
printf("a[%d]=%d是奇数",i,random);
}
}
}
追答
unsigned int array[10];
main(){
for(int i=0;i=10&&random = math.random()*100<=50)return;
}
if(random%%2==0){
array[i]=random;
printf("a[%%d]=%%d是偶数",i,random);
}
if(random%%2!=0){
array[i]=random;
printf("a[%%d]=%%d是奇数",i,random);
}
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询