Conditional enumeration
/*
==================================================
Title: series that can be divisible by 2,3,5 at the same time
==================================================
*/
#include <stdio.h>
#define P 10000000
void Main ()
{
int n,s=0,n;
printf ("How many items do you want the output to be divisible by 2,3,5 at the same time?") \nn= ");
scanf ("%d", &n);
for (n=1;n<=p;n++)
{
if (n%2==0&&n%3==0&&n%5==0)
{
s++;
if (s<n)
{
printf ("%5d", N);
if (s%10==0)
printf ("\ n");
}
}
}
printf ("\ n");
}
/*
==================================================
Comment: Multi-Conditional enumeration method, often practice it, the basis of the foundation.
==================================================
*/
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Basic algorithm of C language 27-conditional remainder