LoginSignup
1

More than 5 years have passed since last update.

FizzBuzz(糞コード)

Posted at
Test.cs
using System;

name space FizzBuzz
{
class Program
{
static void Main(string[]args)
{
 for(int i=1; i<=100; i++)
{
  if(i%3==0 && i%5==0)
{
 Console.WriteLine("FizzBuzz");
}
else if(i%3==0)
{
Console.WriteLine("Fizz");
}
else if(i%5==0)
{
Console.WriteLine("Buzz");
}
else{
Console.WriteLine("{0}",i);
}
}
}
}

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1