로또 썸네일형 리스트형 【파이썬】로또 번호 생성기 코딩 예시 "명성을 쌓는 데는 20년이란 세월이 걸리며, 명성을 무너뜨리는 데는 채 5분도 걸리지 않는다. 그걸 명심한다면, 당신의 행동이 달라질 것이다." - 워런 버핏 "It take 20 years to build a reputation and five minute to ruin it. If you think about that, you'll do things differently." - Warren Buffett 파이썬(Python)을 활용한 로또 번호 생성기 코딩 예시 입니다. import random my_bokkoun = [] my_bokkoun = random.sample(range(1, 46), 6) my_bokkoun.sort() print(my_bokkoun) 위 코딩처럼 5줄이면 로또 번호 생.. 【C언어】 로또 프로그램 예시 C언어에서 로또 프로그램을 만드는 예시입니다. #include "stdio.h" #include "stdlib.h" #include "time.h" void main() { int a, b, i, j; //변수지정 b = 1; while (b) { //반복문 printf("몇 개의 조합을 원하십니까? : "); scanf_s("%d", &a); srand((unsigned)time(NULL)); //랜덤함수 { { for (j = 0; j < a; j++) { for (i = 0; i < 6; i++) { printf("%d ", rand() % 100); }printf("\n"); } } printf("더 하시겠습니까? (네 : 1, 아니오 : 0 :"); scanf_s("%d", &b); } } } .. 이전 1 다음