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
- matplotlib
- 파이썬
- SimpleImputer
- Python
- 불용어
- sklearn
- Outlier
- countplot
- value_counts
- DataFrame
- subplots
- interpolate
- 이상치
- 누락값
- MSE
- 결측치
- koNLPy
- BDA
- Seaborn
- 전처리
- join
- stopwords
- Boxplot
- 대치법
- 결측치대체
- 데이터프레임
- 보간법
- 선형보간
- IterativeImputer
- KoNLP
Archives
- Today
- Total
ACAIT
[C] 0403_5주차 Chapter 04 본문
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> void main() { /// 230403 4주차 /// 4-1) 산술 연산자: 대입 연산자, 증감 연산자 int a = 10, b; b = ++a; // 추가하고 바로 대입 printf("%d\n", b); // 1+10=11 printf("%d\n", a); // 1+10=11 b = a++; // 대입하고 나중에 추가 printf("%d\n", b); // 1+10=11 printf("%d\n", a); // 11+1=12 int c = 10, d; d = c++; printf("%d\n", d); // 10=10 printf("%d\n", c); // 10+1=11 d = ++c; printf("%d\n", d); // 1+11=12 printf("%d\n", c); // 1+11=12 /// 관계 연산자 int a1 = 100, b1 = 200; printf("%d == %d는 %d이다.\n", a1, b1, a1 == b1); printf("%d != %d는 %d이다.\n", a1, b1, a1 != b1); printf("%d > %d는 %d이다.\n", a1, b1, a1 > b1); printf("%d < %d는 %d이다.\n", a1, b1, a1 < b1); printf("%d >= %d는 %d이다.\n", a1, b1, a1 >= b1); printf("%d =< %d는 %d이다.\n", a1, b1, a1 <= b1); printf("%d = %d는 %d이다.\n", a1, b1, a1 = b1); /// 4-2) 비트 연산자 // 비트 논리합(^) 연산자 char aa = 'A', bb, cc; char mask = 0x0F; printf("%X & %X = %X \n", aa, mask, aa & mask); printf("%X | %X = %X \n", aa, mask, aa | mask); mask = 'a' - 'A'; bb = aa ^ mask; printf("%c & %d = %c \n", aa, mask, bb); aa = bb ^ mask; printf("%c & %d = %c \n", aa, mask, bb); // 비트 부정(~) 연산자 int a = 12345; printf("%d\n", ~a); printf("%d\n", ~a + 1); // 예제모음 08) float num1, num2; printf("첫 번째 계산할 값을 입력하세요 => "); scanf("%f", &num1); printf("두 번째 계산할 값을 입력하세요 => "); scanf(" %f", &num2); printf("%5.2f + %5.2f = %5.2f\n", num1, num2, num1 + num2); // %5.2f == 총 다섯 자리 중에서 소숫점은 두 자리. printf("%5.2f - %5.2f = %5.2f\n", num1, num2, num1 - num2); printf("%5.2f * %5.2f = %5.2f\n", num1, num2, num1 * num2); printf("%5.2f / %5.2f = %5.2f\n", num1, num2, num1 / num2); printf("%d %% %d = %d\n", (int)num1, (int)num2, (int)num1 % (int)num2); // 예제모음 09) int money, c500, c100, c50, c10; printf("## 교환할 돈은? "); scanf("%d", &money); c500 = money / 500; money = money % 500; printf("오백 원짜리 ==> %d 개\n", c500); c100 = money / 100; money = money % 100; printf("백 원짜리 ==> %d 개\n", c100); c50 = money / 50; money = money % 50; printf("오십 원짜리 ==> %d 개\n", c50); c10 = money / 10; money = money % 10; printf("십 원짜리 ==> %d 개\n", c10); printf("바꾸지 못한 잔돈 ==> %d 원\n", money); // 예제모음 10) int year; printf("연도를 입력하세요. : "); scanf("%d", &year); if ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))) { printf("%d 년은 윤년입니다. \n", year); } else { printf("%d 년은 윤년이 아닙니다. \n", year); } } | cs |
'전공 및 코드 > C프로그래밍' 카테고리의 다른 글
[C] LAB 0508_로또 번호 생성해 파일에 저장_FILE, srand() (0) | 2023.05.14 |
---|---|
[C] LAB 0501_배열 내림차순_포인터 활용 (0) | 2023.05.14 |
[C] C언어 for Beginner 4판 Chapter 08~11 예제 풀이 (0) | 2023.05.14 |
[C] 0507_Chapter 08~09 연습문제 풀이 (0) | 2023.05.08 |
[C] 0501_9주차 Chapter 08 (0) | 2023.05.07 |