实验四{4}

#include<stdio.h>
int main(){
 int a[99];
 int i,j;
 for(i=0;i<99;i++)
  a[i]=i+2;
 for(j=2;j<=10;j++)
  for(i=0;i<99;i++)
   if(a[i]%j==0)
    a[i]=0;
 for(i=0;i<99;i++)
  if(a[i]!=0)
   printf("%d ",a[i]);
 return 0;
}

猜你喜欢

转载自www.cnblogs.com/P201821430017/p/10912103.html