Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- join
- stopwords
- Python
- Seaborn
- sklearn
- IterativeImputer
- DataFrame
- Boxplot
- 파이썬
- 불용어
- countplot
- 이상치
- 결측치대체
- KoNLP
- 전처리
- 누락값
- SimpleImputer
- BDA
- value_counts
- 대치법
- MSE
- koNLPy
- interpolate
- Outlier
- 데이터프레임
- 보간법
- matplotlib
- 결측치
- subplots
- 선형보간
Archives
- Today
- Total
ACAIT
[C] LAB 0508_로또 번호 생성해 파일에 저장_FILE, srand() 본문
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 | #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> // 난수 srand() 사용 위한 함수 #include <time.h> // time() 사용 위한 함수 void main() { FILE *wtp; wtp = fopen("c:\\temp\\ex11.txt", "w"); int random = 0; int i; printf("### 로또 번호 다섯 개 ### \n\n"); fprintf(wtp, "### 로또 번호 다섯 개 ### \n\n"); srand(time(NULL)); // 실행 시마다 랜덤 난수 나오도록. for (i = 0; i < 5; i++) { random = rand() % 100 + 1; // 1부터 100까지의 수에서 랜덤 printf("추출 숫자 => %d\n", random); fprintf(wtp, "추출 숫자 => %d\n", random); } printf("\n"); fclose(wtp); } // 로또 복권 만들기 - 5개 숫자 난수 랜덤 받기. | cs |
'전공 및 코드 > C프로그래밍' 카테고리의 다른 글
[C] C언어 for Beginner 4판 Chapter 08~10 연습문제 (1) | 2023.06.16 |
---|---|
[C] LAB 0515 전자시계(날짜, 요일, 정각 소리, AM/PM) (0) | 2023.05.17 |
[C] LAB 0501_배열 내림차순_포인터 활용 (0) | 2023.05.14 |
[C] 0403_5주차 Chapter 04 (0) | 2023.05.14 |
[C] C언어 for Beginner 4판 Chapter 08~11 예제 풀이 (0) | 2023.05.14 |