快来帮个忙啊 C语言的 大哥进来

来源:百度知道 编辑:UC知道 时间:2024/05/17 09:05:46
在正整数中找出一个最小的,被3,5,7,9除余数分别为1,3,5,7的数,将数以格式“%d"输出

#include<stdio.h>
#include<math.h>
void main()
{

}
怎么填呢

#include<stdio.h>
#include<math.h>
#include <time.h>
#include <stdlib.h>

void main()
{
int i;
srand( (unsigned)time( NULL ) );
int temp=rand();
for(i=0;i<temp;i++)
if(i%3==1&&i%5==3&&i%7==5&&i%9==7)
{
printf("%d\n",i);
break;
}
}

#include<stdio.h>
#include<math.h>
void main()
{
int i;
for(i=0;i<10000;i++)
if(i%3==1&&i%5==3&&i%7==5&&i%9==7)
{
printf("%d\n",i);
break;
}
}

int x=1,w=1;
while(w)
{ if(x%3==1&&x%5==3&&x%7==5&&x%9==7)
w=0;
x++;
}
printf("%d",x);

你的问题 应该是 除3,5,7,9余数分别为1,3,5,7的数吧!