본문 바로가기 메뉴 바로가기

The Nights

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

The Nights

검색하기 폼
  • 분류 전체보기 (114)
    • 알고리즘 (17)
      • Python (6)
      • C++ (6)
    • CS (0)
    • Backend (21)
      • 로드맵 (1)
      • Java (17)
      • Spring (3)
      • Spring Framework (0)
      • Spring Boot (0)
    • TIL (0)
    • Flutter (13)
    • Python (8)
      • 디스코드 챗봇 (1)
      • 문법 (2)
      • 머신러닝 (2)
    • C (28)
      • 문법 (19)
    • ETC (10)
      • Git (3)
      • GitHub (1)
      • Hacking (4)
    • Game (13)
      • Unity (13)
  • 방명록

동적할당 (1)
[C] 백준 1546 - 배열 동적 할당

// 1546 #include #include int main(void) { // 시험 본 과목 수 n int n; float max = 0, sum = 0; scanf("%d", &n); float* score = (float*)malloc(sizeof(float) * n); for (int i = 0; i max) max = score[i]; } for (int i = 0; i < n; i++) { sum += (score[i] / max) * 100; } float avg = sum / n; printf("%f", avg); free(score); return 0; } 과목..

C/문법 2022. 4. 25. 00:33
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • DART
  • 미로찾기
  • github
  • 콘솔창
  • 공백포함
  • Unity
  • 백준
  • 자료형
  • split
  • scanf
  • sourcetree
  • 1546
  • 동적할당
  • 아스키코드
  • 이중포인터
  • 문자열 함수
  • c언어
  • Failed to create GICache
  • 절대강좌유니티
  • 형변환
  • C심화
  • 이미지분류
  • TensorFlow
  • 1152
  • C
  • 코뮤니티
  • nullsafety
  • 11720
  • 2차원 배열
  • generics
more
«   2025/06   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바