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

Lifelog

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

Lifelog

검색하기 폼
  • j0n9m1n1 (409)
    • OS (14)
      • Windows (1)
      • Linux (3)
      • Home Assistant (6)
    • C, C++ (25)
      • 데이터구조 & 자료구조 (13)
      • Baekjoon Online Judge (195)
      • 정올 (15)
      • Project Euler (2)
      • openCV (2)
      • MFC (0)
    • Java (16)
      • for Class, Project (16)
    • Android (2)
      • for Class, Project (2)
    • Python (15)
      • Django (1)
      • Note (10)
      • PyQt5 (3)
    • Trip (1)
      • OSAKA & KYOTO (1)
    • Others (64)
      • Computer (9)
      • Review (47)
    • Cook (19)
      • 더 푸드 랩(The Food Lab) (14)
      • 만개의레시피 (4)
      • 유튜브 (0)
  • 방명록

C언어 재귀이용 피보나치(Fibonacci) 수열

#include int Fibo(int N){ if(N == 1){ return 0;} else if(N == 2){ return 1;} else{ return Fibo(N - 1) + Fibo(N - 2);} } int main(void){ int i; for(i = 1; i < 15; i++){ printf("%d ", Fibo(i));} } OUTPUT0 1 1 2 3 5 8 13 21 34 55 89 144 233

C, C++/데이터구조 & 자료구조 2016. 6. 6. 20:22
Problem 2 - Even Fibonacci numbers C언어

// Even Fibonacci numbers//400만 미만//짝수만#include int Fibo(int N); int main(void){ int i, j, arr[100] = {0, }, sum = 0; for(i = 1; i

C, C++/Project Euler 2016. 6. 6. 20:22
C언어 재귀 팩토리얼(Factorial) 예제

#include int Factorial(int N){ if(N == 0){ return 1;} else{ return N * Factorial(N - 1);}} int main(void){ printf("1! = %d\n", Factorial(1));printf("2! = %d\n", Factorial(2));printf("3! = %d\n", Factorial(3));printf("4! = %d\n", Factorial(4));printf("9! = %d\n", Factorial(9));} OUTPUT1! = 1 2! = 2 3! = 6 4! = 24 9! = 362880

C, C++/데이터구조 & 자료구조 2016. 6. 6. 20:21

티스토리 방명록

이전 1 ··· 107 108 109 110 111 112 113 ··· 137 다음
Previous Next
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday

Blog is powered by Tistory / Designed by Tistory
Contact: j0n9m1n1@gmail.com

티스토리툴바