P

@parkajeong

2/14 파이썬 연습문제

Python
9 months ago
list = [] for i in range(10): x = int(input()) list.append(x) count = 0 for i in range(10): if list[i] > 0:

2/14 c언어 배열

C
9 months ago
#include <stdio.h> int main() { int arr1[5]; //선언 arr1[0] = 30; //초기화 arr1[4] = 2; printf("%d %d\n", arr1[0], arr1[4]); int arr2[5] = {20, 40, 60, 90, 10}; for(int i=0;i<5;i++){

2/7 c언어 연습 문제 (시윤, -승우-, 승후, -세현-)

C
9 months ago
#include <stdio.h> int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); int avg = (a + b + c) / 3; if (avg > 80){ printf("우수"); }else{ printf("보통");

2/14 파이썬 함수, 메서드, 모듈 (도윤)

Python
9 months ago
import math import random def add(): return 10 + 20 print(add()) def add2(a, b): return a + b

2/14 배열 (-주완-, 도윤)

C
9 months ago
#include <stdio.h> int main() { int array[6]; //배열 선언 array[0] = 10; printf("%d\n", array[0]); int array2[6] = {10, 2, 0, 0, 0, 1}; //초기화 for(int i=0;i<6;i++){ printf("%d\n", array2[i]);

2/11 파이썬 복습 (-담미-,-정윤-,시헌)

Python
9 months ago
numbers = [1, 6, 3, 2, 5] #리스트 맨 끝에 원소를 추가하는 것 numbers.append(7) print(numbers) #내가 원하는 인덱스 위치에 원소를 추가하는 것 numbers.insert(3, 4) print(numbers)

2/9 파이썬 복습 (담미, 정윤, 시헌)

Python
9 months ago
i = 0 while True: if i == 3: break print(i) i+=1 num = 0 while num < 10: num += 1

2/7 c언어 함수

C
9 months ago
#include <stdio.h> char name1[10] = "김알고"; int add(int a, int b); //함수 선언 float add2(); void minus(int a, int b, int c); void name(); void calculate(int a, int b, int c);

2/7 파이썬 지역변수&전역변수, 메서드, 모듈

Python
9 months ago
import math import random a = 10 def hello(): global a b = 10 print(a + b) hello()

2/7 c언어 연습 문제 (시윤, 승우, 승후, 세현)

C
9 months ago
#include <stdio.h> #include <string.h> int main() { // char str1[10]; // char str2[10]; // scanf("%s", str1); // scanf("%s", str2); // for(int i=0;i<strlen(str1);i++){ // printf("%c", str1[i]);

2/7 c언어 함수 (복습) (주완, 세현, 도윤)

C
9 months ago
#include <stdio.h> int add(); //함수 선언 int minus(int a, int b); void add2(int a, int b); void minus2(); int add3(int a, int b); int mul(int a, int b); void printA(int a);

2/4 파이썬 복습 2 반복문 (담미, 정윤, 시헌)

Python
9 months ago
for i in [1,2,3]: print('*') i+=1 for i in "abcd": print("#") for i in range(4): #4번 반복 0~3 print(i)

2/2 파이썬 복습 자료형 (담미, 정윤, 시헌)

Python
9 months ago
# 자료의 형태 - 자료형 # 문자열 - " ", '' # 정수 - 5 7 80 7 # 실수 - 1.5 8.6 # 리스트 - [] # 튜플 - (1,) # 딕셔너리 - {key : value, key2 : value2} # 산술연산자 - 숫자 계산 # + 더하기

1/31 파이썬 함수 (예린, 예원)

Python
9 months ago
#내장함수 numbers = [10, 30, 4, 64, 32, 17, 9] print(min(numbers)) #리스트 안에서 최솟값 찾기 print(max(numbers)) #리스트 안에서 최댓값 찾기 #사용자 정의 함수 def compare(a, b): if a > b: print(f"{a}가 더 큽니다.") else:

1/31 파이썬 여러가지 자료형과 메서드 (예린, 예원)

Python
9 months ago
#pop - n번째 원소 제거 fruits = ['딸기', '포도', '사과', '체리'] #fruits.remove('포도') fruits.pop(1) fruits.pop() #맨 마지막을 삭제 print(fruits) #count - 특정 자료의 개수 조회 nums = [2, 2, 2, 3, 3, 4, 5] print(nums.count(2))

1/31 파이썬 숙제 풀이 (예린, 예원)

Python
9 months ago
#1) n = int(input()) sum = 0 i = 1 while i <= n: sum += i i += 1 print(sum) #2)

1/31 c언어 random (예린, 예원)

C
9 months ago
#include <stdio.h> #include <stdlib.h> #include <time.h> int main() { srand(time(NULL)); //난수 초기화 int r; rand() % 3; //0~2까지 3가지 r = rand() % 3+1; //1~3까지 3가지 printf("%d\n", r);

1/31 c언어 조건문 if문, break문, continue문, switch문 (예린, 예원)

C
9 months ago
#include <stdio.h> int main() { int age = 10; if (age >= 8){ printf("초등학생입니다.\n"); }else{ printf("유치원생입니다.\n"); }

1/31 c언어 동물 키우기 게임 (시윤, 승우, 승후)

C
9 months ago
#include <stdio.h> int main() { int hungry = 5, happy = 5, health = 5; char name[10]; scanf("%s", name); while(1){ for(int i=0; i<10; i++){ printf("%c", name[i]);

1/31 c언어 동물키우기 게임 (준우)

C
9 months ago
#include <stdio.h> int main() { int hungry = 5, happy = 5, health = 5; while(1){ printf("[내 펫 상태]\n"); printf("배고픔: %d, 행복함: %d, 체력: %d\n", hungry, happy, health); printf("시작! 1: 밥주기 2: 놀아주기 3: 쉬기 4: 종료\n");