import Foundation
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.")
for i in (2...98).reversed()
{
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.")
}
else
{
print(i, "bottles of beer on the wall,", i, "bottles of beer. Take one down and pass it around,", i-1, "bottles of beer on the wall.")
}
}
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.")
package main
import "fmt"
func main() {
i := 0
fmt.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 = 98; i >= 2; i-- {
if i == 2 {
fmt.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 {
fmt.Print(i, " bottles of beer on the wall, ", i, " bottles of beer. Take one down and pass it around, ", i-1, " bottles of beer on the wall.\n")
}
}
fmt.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.")
}
'IT' 카테고리의 다른 글
[Rust] 99병의 맥주 (0) | 2022.06.23 |
---|---|
[Go & Python] 특수기호로 표현한 로딩중 (0) | 2022.06.23 |
화이트리스트 기반 프로세스 검사 프로그램도 만들긴 했는데요... (0) | 2022.06.08 |
스터디그룹 프로젝트 - 화이트리스트 기반 파일 검사 프로그램 개발 완료 (0) | 2022.06.02 |
Clang을 이용하여 포코 X3 NFC 커널 빌드 성공 (0) | 2022.05.30 |