-
2017.09.01
실행 시간 측정 (clock() 이용)
1 2 3 4 5 6 7 8 9 10 11 12 13 #include void main() { double start, finish, duration; start = clock(); // 시작 시간 Algorithm(); // 측정하려는 알고리즘 finish = clock(); // 종료 시간 // duration에 시간 저장 duration = ((double)(finish - start)/CLOCKS_PER_SEC); } Colored by Color Scripter cs More Information : http://www.cplusplus.com/reference/ctime/clock/
-
2017.09.01
[Web] cplusplus
cplusplus . http://www.cplusplus.com/ This site has lots of information about C++. (Information, Tutorials, Reference, Articles and Forum) I use this site to refer to C/C++ references.
-
2017.09.01
goto문
*goto문 - 기존 어셈블리 코드에서 사용하는 기능을 상위 프로그래밍 언어에 접목시키는 과정에서 생겨난 기능. - 무조건 원하는 레이블로 건너뛰는 기능을 함. - 형식 문장A; goto Label1; 문장B; ... Label1: 문장C; -> 문장A를 실행한 후에 바로 문장C를 수행. (문장 B는 실행 되지 않음.) - 코드 예시 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #include int main() { int i, j; i = j = 0; printf("goto문의 테스트입니다."); do { printf("do-while문의 %d번째 반복입니다. \n", i); for(j = 0; j