K

@kimjiyeon

42쪽 내 컴퓨터 데이터형 크기

C
1 month ago
#include <stdio.h> int main() { printf("문자형 크기 : %d바이트\n", sizeof(char)); printf("정수형 크기 : %d바이트\n", sizeof(int)); printf("short형 크기 : %d바이트\n", sizeof(short)); printf("long형 크기 : %d바이트\n", sizeof(long)); printf("단정도 실수형 크기 : %d

41쪽 증감연산자

C
1 month ago
#include <stdio.h> int main() { int a, b, c; a = b = c = 0; a = ++b + ++c; //b=1, c=1, a=2 printf("%d %d %d \n", a, b, c); //2, 1, 1 a = b++ + c++; //b=1, c=1, a=2 printf("%d %d %d \n", a, b, c); //2, 2, 2 a = b++ + c++;

30쪽 형변환 sum_cast

C
1 month ago
#include <stdio.h> int main() { int sum; float x = 1.3, y=1.8; sum = x+y; printf("자동 변환한 sum= %d \n", sum); sum = (int)x + (int)y; printf("cast 사용한 형변환 sum=%d \n", sum); }

29쪽 열거형예제

C
1 month ago
#include <stdio.h> #include <stdbool.h> int main(void) { enum color {white, red, blue, green, black} farbe; int a[5], i; bool yesno; yesno = true; if(yesno) { for (farbe = white; farbe <= black; farbe++)

기출2023_C언어

C
1 month ago
#include <stdio.h> int main(void) { int i, k, m, row, n=0; printf("층수를 입력하세요:"); scanf("%d", &row); for(i=0; i<row; k=0, i++) { for (k=0; k<row-i-1; k++) printf("*");

점수

Python
5 months ago
score = '83.2' print('획득 점수는') print(score + '점입니다') score = float(score) score = score + 10 score=str(score) print('최종 점수는')

list.py

Python
7 months ago
print('Hello world!')

bomb.py

Python
7 months ago
# 2차원 배열 행row, 열col이 입력되고, 그 다음 줄부터 배열의 요소로 들어갈 문자가 입력된다. # * = 지뢰 # . 은 지뢰가 아니다. # 지뢰가 아닌 요소에 인접한 지뢰의 수를 출력하는 프로그램을 작성해보자. """ 입력 3 3 .** *..

even_total.py

Python
7 months ago
total = 0 for i in range(1, 11): if i % 2 == 0: total += i print("짝수의 합:", total)

sum_1_5

Python
7 months ago
total = 0 for i in range(1, 6): total += i print("1부터 5까지의 합:", total)

if_else.py

Python
7 months ago
ID = "jiyeon" password = "1004" user_ID = input("아이디를 입력하세요: ") if user_ID == ID: for chance in range(3, 0, -1): #3, 2, 1로 반복 print(f"로그인 시도 남은 횟수 : {chance} ")

traffic_light.py

Python
7 months ago
# 신호등 프로그램 light = input("신호등 색깔을 입력하세요. (빨강/노랑/초록 중에 입력하세요) \n") print('나의 답변: ' + light) if light == "빨강": print("멈추세요! 🚫") else: print("건너세요! 🟢")

calculate_2.py

Python
7 months ago
print("===계산기===") a = int(input('첫 번째 숫자: ')) b = int(input('두 번째 숫자: ')) print("덧셈 결과 : ", a+b) print("뺄셈 결과 : ", a-b) print("곱셈 결과 : ", a*b) print("나눗셈 결과 : ", a/b)

input.py

Python
7 months ago
name = input('이름을 입력하세요: \n') age = input('나이를 입력하세요: \n') print('안녕하세요. ' , name, '님!') print('내년에', int(age)+1, '살이 되시겠네요!')

calculate.py

Python
7 months ago
a = 10 b = 3 print("a + b =", a + b) print("a - b =", a - b) print("a * b =", a * b) print("a / b =", a / b) print("a // b =", a // b) # 몫 print("a % b =", a % b) # 나머지