Last active
November 14, 2022 09:15
-
-
Save organic-nailer/7a0bfee910f1467da9e1c92ac51baffb to your computer and use it in GitHub Desktop.
2022 WebアプリをFlutterで作ろう#1 /2020 FlutterでWebアプリ開発初級編#1 演習解答
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
//つよいと出力するやつ | |
void main() { | |
int level = 10; | |
if(level >= 50) { | |
print("つよい"); | |
} | |
else { | |
int rem = 50 - level; | |
print("あと $rem レベル足りないよね"); | |
} | |
} |
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
//FizBuz | |
void main() { | |
for(int i=1;i < 100; i = i + 1) { | |
if(i % 15 == 0) { | |
print("Fizz Buzz"); | |
} | |
else if(i % 5 == 0) { | |
print("Buzz"); | |
} | |
else if(i % 3 == 0) { | |
print("Fizz"); | |
} | |
else { | |
print(i); | |
} | |
} | |
} |
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
//フィボナッチ | |
void main() { | |
int now = 1; | |
int prev = 0; | |
for(int i = 0; i < 100; i++) { | |
print(now); | |
int tmp = prev; | |
prev = now; | |
now = now + tmp; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment