본문 바로가기

웅재의 코딩세상

검색하기
웅재의 코딩세상
프로필사진 웅드

  • 분류 전체보기 (304)
    • 코딩테스트 (226)
      • c++ (17)
      • 프로그래머스 - LV 0 (165)
      • 프로그래머스 - LV 1 (44)
      • 프로그래머스 - LV 2 (0)
    • android 개발 (12)
      • android 이론(flutter) (5)
      • android 실습(flutter) (7)
    • 개념 (51)
      • c++ (18)
      • 자료구조 (17)
      • 알고리즘 (14)
      • cloud (2)
    • 프로젝트 (13)
      • 휘봉고 멘토링 (2)
      • 졸업작품 프로젝트 (5)
      • AI Deep Voice lab (2)
      • 제18회 임베디드 SW 경진대회 (4)
    • AI보안연구센터 연구원 (0)
      • 논문 (0)
Guestbook
Notice
Recent Posts
Today
Total
«   2025/09   »
일 월 화 수 목 금 토
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
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록2018번 (1)

웅재의 코딩세상

연속된 자연수의 합 구하기 ( 백준 -2018번)

손으로 풀기 2. 코드 구현하기 #include #include #include using namespace std; int main(){ int N; cin >> N; int count =1; int start_point = 1; int end_point = 1; int sum = 1; while(end_point != N){ if(sum ==N){ count++; end_point++; sum += end_point; } else if(sum > N){ sum -= start_point; start_point++; } else{ end_point++; sum+= end_point; } } cout

코딩테스트/c++ 2023. 5. 24. 14:28
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바