본문 바로가기

CHIqueen

검색하기
CHIqueen
프로필사진 CHIqueen

  • 분류 전체 보기 (82)
    • 자격증 (2)
      • 디지털포렌식 전문가 2급 (1)
      • 네트워크 관리사 2급 (1)
    • 포렌식 (48)
      • CTF (39)
      • Analysis (6)
      • 도구 (0)
      • 삽질 (1)
    • 프로그래밍 (30)
      • Python (9)
      • CodeSignal (20)
      • Golang (1)
Guestbook
Notice
Recent Posts
  • `21년 시행계획
  • 필기 접수
  • 무결성 관련 판례
  • 독수독과 이론 관련 판례
Recent Comments
  • 깊게 안해봐서 잘은 모르겠지⋯
  • 우선 코드는 감사합니다 마지⋯
Link
  • Go언어 블로그
«   2020/06   »
일 월 화 수 목 금 토
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
Tags
more
Archives
  • 2021/04 (2)
  • 2020/10 (2)
  • 2020/06 (1)
  • 2020/05 (2)
Today
14
Total
11,057
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록2020/06/06 (1)

CHIqueen

Golang Guessing game 게싱게임

package main import( "fmt" "math/rand" "time" ) func main(){ fmt.Println("Guessing game") rand.Seed(time.Now().UnixNano()) secNum := rand.Intn(100) var guess int for { fmt.Scan(&guess) fmt.Println("You guessed", guess) if guess < secNum { fmt.Println("Up") } else if guess > secNum { fmt.Println("Down") } else { fmt.Println("Correct!") break } } } 간단한 Go 언어 예제 math/rand와 time을 사용했다.

프로그래밍/Golang 2020. 6. 6. 01:30
Prev 1 Next

Blog is powered by kakao / Designed by Tistory