전체 글
-
1. 객체지향 개념카테고리 없음 2017. 2. 23. 21:46
1. 절차적 방법론 '어떤 문제를 해결하기 위한 과정을 순차적으로 설계하는 방법론' 2. 객체지향적 방법론 정의 : 흠.. 절차적 방법론과 객체지향적 방법론의 차이 코끼리를 냉장고에 넣는다. - 절차적 방법론 : 냉장고 문을 연다 -> 코끼리를 접는다 -> 코끼리를 넣는다 -> 냉장고 문을 닫는다. - 객체지향적 방법론 : 조교에게 시킨다. - 'c,c++로 배우는 자료구조론. 한빛미디어' 중 개념은 이해가 가지만 절차적 방법론의 반대가 객체지향적 방법론이라고는 생각할 수가 없다. 좀더 생각을 해봐야 겠다 http://blog.naver.com/salinokl/60208910532 참고
-
5. 로또 확률컴퓨터기초/#1 알고리즘 100선 2017. 2. 21. 17:59
#include #include #include #define MAXROLL 100000 void make_num(int*, int); int main() { int success_num[7]; int try_num[6]; int i, j, tryout = 0; int match, bonus; int grade[6] = {0,0,0,0,0,0}; srand(time(NULL)); make_num(&success_num, 7); for(tryout = 1; tryout < MAXROLL; tryout++) { match = 0; bonus = 0; make_num(&try_num[0],6); for(i = 0; i < 6; i++) { for(j = 0; j < 6; j++) { if(success_num..
-
4. 글자 거꾸로 출력컴퓨터기초/#1 알고리즘 100선 2017. 2. 21. 16:25
#include #define MAX 125 int main() { char stor[MAX]; char stor2[MAX]; int i, j; char test; gets(stor); //엔터가 치기까지 문자열을 저장(space 포함) for(i = 0; i < 125; i++) { if(stor[i] == '\0') //엔터가 쳐진 위치를 배열로 알기위해서 돌리는 for break; } //방법 1 for(j = 0; j < i; j++) stor2[j] = stor[i-j-1]; stor2[i] = '\0'; for(j = 0; j < i; j++) { if(stor2[j] < 0) //한글은 2바이트가 필요해서 완전뒤집으면 안되고 2byte씩 뒤집어야 함 { test = stor2[j]; stor..
-
3. 피보나치 수열컴퓨터기초/#1 알고리즘 100선 2017. 2. 18. 23:59
#include #define COUNT 40 // about 47~ more scope than Int int main() { int num[COUNT]; int i; num[0] = num[1] = 1; for(i = 1; i < COUNT; i++) { num[i+1] = num[i] + num[i-1]; printf("%d ", num[i-1]); } printf("%d", num[COUNT-1]); return 0; } 피보나치 수열이 이렇게 빨리 늘어나는지 새삼스레 깨달았당. 재귀를 사용한 피보나치 Python version full_count = 0 def fibo(num) : global full_count full_count += 1 if num
-
혼자가는 4박 5일 도쿄 여행 - 3이야기/여행 2017. 2. 17. 18:32
도쿄 여행 세번째 날. 알람을 듣고 일어나서 목욕하고 체크아웃해서 10시 전에 나와 아침에 돌아다니다가 드디어 리본 바가 어딨는지 알아냈다. 진짜 간판으로 찾기는 힘들어... 앞에 보이는 이 건물 8층이었다. 여는 시간은 오후 6시 이후. 바로 갈것인가 다른 지역으로 갈것인가.. 아침부터 고민이 많아졌다. 리본 바는 여기 8층 ㅠㅠ 리본 바랑 리본 가라오케랑 리본 코스프레 바 3개가 신주쿠에 흩어져 있음 일단 캡슐호텔에서 나와서 커피도 마실겸 담배도 필겸, 카페로 갔다. 마침 모닝세트가 있길래 시키고 (400엔 정도 한듯) 먹었다. 오랜만에 포켓몬 고를 켰더니만 일본은 역시 클라스가 다르긴 했다. (스샷을 찍었지만 폰 초기화 해서 없어짐 ㅠㅠ) 도쿄라 그런지 5미터도 안가서 포켓스탑이 하나씩 있음. 여기..