Last active
August 5, 2018 07:34
-
-
Save dicenull/961a3ac231a85bdc8c258d4587d8e3a6 to your computer and use it in GitHub Desktop.
Hello_world-Fizz_Buzz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
std::cout << "Hello, world!" << std::endl; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout << "Hello, world!" << endl; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespcae std; | |
int main(int argc, char **argv) | |
{ | |
cout << "Hello, world!" << endl; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int n; | |
n = 3; | |
n = n + 2; | |
cout << n << endl; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int n = 2; | |
if(n % 2 == 0) | |
{ | |
cout << n << "は偶数" << endl; | |
} | |
else | |
{ | |
cout << n << "は奇数" << endl; | |
} | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
for(int i = 0;i < 10;i++) | |
{ | |
cout << i << endl; | |
} | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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