FizzBuzz问题



void printFizzBuzz()
{
int n = 100;
for (int i = 0;i <= n; i ++)
{
if (i%3==0)
{
if (i%5==0)
{
printf("FizzBuzz\n");
}else{
printf("Fizz\n");
}
}else if (i%5==0)
{
printf("Buzz\n");
}else{
printf("%d\n",i);
}
}
}






Loading Disqus comments...
Table of Contents