fn main() {
print!("99 bottles of beer on the wall, 99 bottles of beer. Take one down and pass it around, 98 bottles of beer on the wall.\n");
for i in (1..99).rev()
{
if i == 2
{
print!("2 bottles of beer on the wall, 2 bottles of beer. Take one down and pass it around, 1 bottle of beer on the wall.\n");
}
else
{
print!("{} bottles of beer on the wall, {} bottles of beer. Take one down and pass it around, {} bottles of beer on the wall.\n", i, i, i-1);
}
}
print!("1 bottle of beer on the wall, 1 bottle of beer. Take it down and pass it around, no more bottles of beer on the wall.\nNo more bottles of beer on the wall, no more bottles of beer.Go to the store and buy some more, 99 bottles of beer on the wall.\n");
}
요새 C/C++이나 Java, Python 말고 다른 언어도 해보고 있는데 Swift는 대화형 언어라서 Python이랑 비슷한 느낌으로 어려운데... Rust는 언어가 엄격해서 그런지 얘 자체가 엄청 어렵네요;;
'IT' 카테고리의 다른 글
[Release] WLAV- WhiteList AntiVirus (0) | 2022.07.10 |
---|---|
[Ubuntu] Steam - verifying installation 또는 Steam client's requirements are satis (0) | 2022.07.05 |
[Go & Python] 특수기호로 표현한 로딩중 (0) | 2022.06.23 |
[Swift & Go] 99병의 맥주 (0) | 2022.06.21 |
화이트리스트 기반 프로세스 검사 프로그램도 만들긴 했는데요... (0) | 2022.06.08 |