Skip to content

Instantly share code, notes, and snippets.

@dicenull
Last active August 5, 2018 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dicenull/961a3ac231a85bdc8c258d4587d8e3a6 to your computer and use it in GitHub Desktop.
Save dicenull/961a3ac231a85bdc8c258d4587d8e3a6 to your computer and use it in GitHub Desktop.
Hello_world-Fizz_Buzz
#include <iostream>
int main()
{
std::cout << "Hello, world!" << std::endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, world!" << endl;
return 0;
}
#include <iostream>
using namespcae std;
int main(int argc, char **argv)
{
cout << "Hello, world!" << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int n;
n = 3;
n = n + 2;
cout << n << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int n = 2;
if(n % 2 == 0)
{
cout << n << "は偶数" << endl;
}
else
{
cout << n << "は奇数" << endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int number = 13;
if(number > 10)
cout << number << "は10より大きい" << endl;
else if(number < 10)
cout << number << "は10よりちいさい" << endl;
else
cout << number << "は10に等しい" << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
for(int i = 0;i < 10;i++)
{
cout << i << endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
for(int i = 0;i < 100;i++)
{
if(i % 15 == 0)
cout << "FizzBuzz" << endl;
else if(i % 5 == 0)
cout << "Buzz" << endl;
else if(i % 3 == 0)
cout << "Fizz" << endl;
else
cout << i << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment