SlideShare a Scribd company logo
1 of 12
ALPS C/C++ Study
2016. 3. 5
장 홍 준
목차
• 개요
• 함수
• 자료형 (int, char, bool, float, long long, double, array)
• 조건문(if, else if, else, switch)
• 순환문(for, while, do while)
• 재귀호출
• 파일 입출력(FILE, freopen)
• Standard Template Library - algorithm, vector, string, set, map
• 다른 해더 파일
• 다음 시간에는 포인터 + 기본적인 알고리즘
개요
• 입력과 출력
• 그 사이의 연결고리 – 알고리즘
• 한정된 시간과 메모리 사용량
함수
void show(string s) { cout << s; }
int hi(void) {
show(“Hello World!n”);
return 1;
}
int main(void) {
if (hi(void)) show(“성공n”);
else show(“실패n”);
return 0;
}
반환되는 자료형 / 함수의 인자(parameter) / 함수의 반환(리턴)값
자료형
http://msdn.microsoft.com/ko-kr/library/s3f49ktz.aspx
%2d, %.2lf과 같은 출력 포맷
http://www.acmicpc.net/step/1
https://www.acmicpc.net/step/2
조건문
• If(A?) – else if(not A, not B, … , C?) – else
• Switch (x) {
case 0: a(); break;
case 1: b(); break;
default: c(); break;
}
https://www.acmicpc.net/step/4
순환문
for (시작 명령; 이행 조건; 추가 연산) {
}
while (이행 조건) {
}
do {
} while(이행 조건);
재귀 호출
F(n) = F(n-1) + F(n-2)
F(n-1) = F(n-2) + F(n-3)
F(n-2) = F(n-3) + F(n-4)
…
F(1) = 1
F(n-2) = …
했던 계산을 또 안 하면 순환문과 같은 속도
파일 입출력
• FILE
• freopen
Standard Template Library
• #include <algorithm> : sort, reverse
• #include <vector> : dynamic array
• #include <string> : string
• #include <set> : balanced binary search tree
• #include <map> : balanced binary search tree
다른 해더 파일
• #include <string.h> : strlen, memset
• #include <math.h> : sin, cos, asin, acos, tan, atan, sqrt, hypot
• #include <stdlib.h> : ?....
• #include <time.h> : clock
끝
acmicpc.net에서 연습하다가 문제 발생 → 알프스 톡방에 질문하기
좋은 주말 보내세요.

More Related Content

What's hot

Doing mathwithpython.ch02
Doing mathwithpython.ch02Doing mathwithpython.ch02
Doing mathwithpython.ch02Seok-joon Yun
 
Pyconkr2019 features for using python like matlab
Pyconkr2019 features for using python like matlabPyconkr2019 features for using python like matlab
Pyconkr2019 features for using python like matlabIntae Cho
 
실용주의 디자인패턴 2 인터페이스로 프로그래밍하기
실용주의 디자인패턴   2 인터페이스로 프로그래밍하기실용주의 디자인패턴   2 인터페이스로 프로그래밍하기
실용주의 디자인패턴 2 인터페이스로 프로그래밍하기Cosmos Shin
 
고급 시스템 프로그래밍
고급 시스템 프로그래밍고급 시스템 프로그래밍
고급 시스템 프로그래밍junghee yu
 
Doing math with python.ch07
Doing math with python.ch07Doing math with python.ch07
Doing math with python.ch07Seok-joon Yun
 
알고리즘과 자료구조
알고리즘과 자료구조알고리즘과 자료구조
알고리즘과 자료구조영기 김
 
C언어 세미나 - 함수
C언어 세미나 - 함수C언어 세미나 - 함수
C언어 세미나 - 함수SeungHyun Lee
 
[Commit Again] 1주차 STL study
[Commit Again] 1주차 STL study[Commit Again] 1주차 STL study
[Commit Again] 1주차 STL study경 송
 
[Algorithm] Recursive(재귀)
[Algorithm] Recursive(재귀)[Algorithm] Recursive(재귀)
[Algorithm] Recursive(재귀)Bill Kim
 
Data structure review (summer study)
Data structure review (summer study)Data structure review (summer study)
Data structure review (summer study)Melon Lemon
 
[Swift] Subscripts
[Swift] Subscripts[Swift] Subscripts
[Swift] SubscriptsBill Kim
 
C 언어 스터디 04 - 구조체, 동적할당
C 언어 스터디 04 - 구조체, 동적할당C 언어 스터디 04 - 구조체, 동적할당
C 언어 스터디 04 - 구조체, 동적할당Yu Yongwoo
 
알고리즘 스터디(정렬) Seungdols
알고리즘 스터디(정렬) Seungdols알고리즘 스터디(정렬) Seungdols
알고리즘 스터디(정렬) Seungdolsseungdols
 
Data Structure 1
Data Structure 1Data Structure 1
Data Structure 1yonsei
 
정보과학회 FTL논문 아이디어
정보과학회 FTL논문 아이디어정보과학회 FTL논문 아이디어
정보과학회 FTL논문 아이디어Jaemyung Kim
 
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점if kakao
 

What's hot (20)

Doing mathwithpython.ch02
Doing mathwithpython.ch02Doing mathwithpython.ch02
Doing mathwithpython.ch02
 
Pyconkr2019 features for using python like matlab
Pyconkr2019 features for using python like matlabPyconkr2019 features for using python like matlab
Pyconkr2019 features for using python like matlab
 
Lec 00, 01
Lec 00, 01Lec 00, 01
Lec 00, 01
 
실용주의 디자인패턴 2 인터페이스로 프로그래밍하기
실용주의 디자인패턴   2 인터페이스로 프로그래밍하기실용주의 디자인패턴   2 인터페이스로 프로그래밍하기
실용주의 디자인패턴 2 인터페이스로 프로그래밍하기
 
A tour of go
A tour of goA tour of go
A tour of go
 
고급 시스템 프로그래밍
고급 시스템 프로그래밍고급 시스템 프로그래밍
고급 시스템 프로그래밍
 
Doing math with python.ch07
Doing math with python.ch07Doing math with python.ch07
Doing math with python.ch07
 
알고리즘과 자료구조
알고리즘과 자료구조알고리즘과 자료구조
알고리즘과 자료구조
 
C언어 세미나 - 함수
C언어 세미나 - 함수C언어 세미나 - 함수
C언어 세미나 - 함수
 
[Commit Again] 1주차 STL study
[Commit Again] 1주차 STL study[Commit Again] 1주차 STL study
[Commit Again] 1주차 STL study
 
[Algorithm] Recursive(재귀)
[Algorithm] Recursive(재귀)[Algorithm] Recursive(재귀)
[Algorithm] Recursive(재귀)
 
Data structure review (summer study)
Data structure review (summer study)Data structure review (summer study)
Data structure review (summer study)
 
[Swift] Subscripts
[Swift] Subscripts[Swift] Subscripts
[Swift] Subscripts
 
C 언어 스터디 04 - 구조체, 동적할당
C 언어 스터디 04 - 구조체, 동적할당C 언어 스터디 04 - 구조체, 동적할당
C 언어 스터디 04 - 구조체, 동적할당
 
알고리즘 스터디(정렬) Seungdols
알고리즘 스터디(정렬) Seungdols알고리즘 스터디(정렬) Seungdols
알고리즘 스터디(정렬) Seungdols
 
14 2 iterator
14 2 iterator14 2 iterator
14 2 iterator
 
Cp2 w5
Cp2 w5Cp2 w5
Cp2 w5
 
Data Structure 1
Data Structure 1Data Structure 1
Data Structure 1
 
정보과학회 FTL논문 아이디어
정보과학회 FTL논문 아이디어정보과학회 FTL논문 아이디어
정보과학회 FTL논문 아이디어
 
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점
텐서플로로 OCR 개발해보기: 문제점과 문제점과 문제점
 

Viewers also liked

Problem Solving GuideBook
Problem Solving GuideBookProblem Solving GuideBook
Problem Solving GuideBookHongjun Jang
 
Sqrt decomposition
Sqrt decompositionSqrt decomposition
Sqrt decompositionHongjun Jang
 
Teamwork in programming contests
Teamwork in programming contestsTeamwork in programming contests
Teamwork in programming contestsHongjun Jang
 
ALPS & AlKor Intro Slides
ALPS & AlKor Intro SlidesALPS & AlKor Intro Slides
ALPS & AlKor Intro SlidesHongjun Jang
 
3. basic data structures(2)
3. basic data structures(2)3. basic data structures(2)
3. basic data structures(2)Hongjun Jang
 
4. dynamic programming(1)
4. dynamic programming(1)4. dynamic programming(1)
4. dynamic programming(1)Hongjun Jang
 
2. basic data structures(1)
2. basic data structures(1)2. basic data structures(1)
2. basic data structures(1)Hongjun Jang
 

Viewers also liked (8)

Problem Solving GuideBook
Problem Solving GuideBookProblem Solving GuideBook
Problem Solving GuideBook
 
Sqrt decomposition
Sqrt decompositionSqrt decomposition
Sqrt decomposition
 
Network flow
Network flowNetwork flow
Network flow
 
Teamwork in programming contests
Teamwork in programming contestsTeamwork in programming contests
Teamwork in programming contests
 
ALPS & AlKor Intro Slides
ALPS & AlKor Intro SlidesALPS & AlKor Intro Slides
ALPS & AlKor Intro Slides
 
3. basic data structures(2)
3. basic data structures(2)3. basic data structures(2)
3. basic data structures(2)
 
4. dynamic programming(1)
4. dynamic programming(1)4. dynamic programming(1)
4. dynamic programming(1)
 
2. basic data structures(1)
2. basic data structures(1)2. basic data structures(1)
2. basic data structures(1)
 

Similar to 1. alps c c++

GopherCon Korea 2015 - Python 개발자를 위한 Go (이경찬)
GopherCon Korea 2015 - Python 개발자를 위한 Go (이경찬)GopherCon Korea 2015 - Python 개발자를 위한 Go (이경찬)
GopherCon Korea 2015 - Python 개발자를 위한 Go (이경찬)Kyoungchan Lee
 
C Language For Arduino
C Language For ArduinoC Language For Arduino
C Language For Arduino영욱 김
 
Perl Script Document
Perl Script DocumentPerl Script Document
Perl Script Document오석 한
 
웹 개발 스터디 01 - PHP
웹 개발 스터디 01 - PHP웹 개발 스터디 01 - PHP
웹 개발 스터디 01 - PHPYu Yongwoo
 
Learning Node Book, Chapter 5
Learning Node Book, Chapter 5Learning Node Book, Chapter 5
Learning Node Book, Chapter 5Ji Hun Kim
 
Ch.14 파일 강c v0.6
Ch.14 파일 강c v0.6Ch.14 파일 강c v0.6
Ch.14 파일 강c v0.6승태 김
 
Python programming for Bioinformatics
Python programming for BioinformaticsPython programming for Bioinformatics
Python programming for BioinformaticsHyungyong Kim
 
EcmaScript6(2015) Overview
EcmaScript6(2015) OverviewEcmaScript6(2015) Overview
EcmaScript6(2015) Overviewyongwoo Jeon
 
스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍
스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍
스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍Young-Beom Rhee
 
Scala, Scalability
Scala, ScalabilityScala, Scalability
Scala, ScalabilityDongwook Lee
 
HTML Form과 배열
HTML Form과 배열HTML Form과 배열
HTML Form과 배열Yoonwhan Lee
 
API.Design.for.CPlusPlus.Ch5
API.Design.for.CPlusPlus.Ch5API.Design.for.CPlusPlus.Ch5
API.Design.for.CPlusPlus.Ch5박 민규
 
Kth개발자 세미나 1회
Kth개발자 세미나 1회Kth개발자 세미나 1회
Kth개발자 세미나 1회Byeongsu Kang
 
스칼라와 스파크 영혼의 듀오
스칼라와 스파크 영혼의 듀오스칼라와 스파크 영혼의 듀오
스칼라와 스파크 영혼의 듀오Taeoh Kim
 
Programming Cascading
Programming CascadingProgramming Cascading
Programming CascadingTaewook Eom
 

Similar to 1. alps c c++ (20)

GopherCon Korea 2015 - Python 개발자를 위한 Go (이경찬)
GopherCon Korea 2015 - Python 개발자를 위한 Go (이경찬)GopherCon Korea 2015 - Python 개발자를 위한 Go (이경찬)
GopherCon Korea 2015 - Python 개발자를 위한 Go (이경찬)
 
Apache avro
Apache avroApache avro
Apache avro
 
C Language For Arduino
C Language For ArduinoC Language For Arduino
C Language For Arduino
 
Perl Script Document
Perl Script DocumentPerl Script Document
Perl Script Document
 
웹 개발 스터디 01 - PHP
웹 개발 스터디 01 - PHP웹 개발 스터디 01 - PHP
웹 개발 스터디 01 - PHP
 
Learning Node Book, Chapter 5
Learning Node Book, Chapter 5Learning Node Book, Chapter 5
Learning Node Book, Chapter 5
 
Ch.14 파일 강c v0.6
Ch.14 파일 강c v0.6Ch.14 파일 강c v0.6
Ch.14 파일 강c v0.6
 
ES6 for Node.js Study 2주차
ES6 for Node.js Study 2주차ES6 for Node.js Study 2주차
ES6 for Node.js Study 2주차
 
Python programming for Bioinformatics
Python programming for BioinformaticsPython programming for Bioinformatics
Python programming for Bioinformatics
 
EcmaScript6(2015) Overview
EcmaScript6(2015) OverviewEcmaScript6(2015) Overview
EcmaScript6(2015) Overview
 
스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍
스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍
스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍
 
Scala, Scalability
Scala, ScalabilityScala, Scalability
Scala, Scalability
 
Scalability
ScalabilityScalability
Scalability
 
JDK 변천사
JDK 변천사JDK 변천사
JDK 변천사
 
HTML Form과 배열
HTML Form과 배열HTML Form과 배열
HTML Form과 배열
 
API.Design.for.CPlusPlus.Ch5
API.Design.for.CPlusPlus.Ch5API.Design.for.CPlusPlus.Ch5
API.Design.for.CPlusPlus.Ch5
 
Kth개발자 세미나 1회
Kth개발자 세미나 1회Kth개발자 세미나 1회
Kth개발자 세미나 1회
 
스칼라와 스파크 영혼의 듀오
스칼라와 스파크 영혼의 듀오스칼라와 스파크 영혼의 듀오
스칼라와 스파크 영혼의 듀오
 
PHP 기초 문법
PHP 기초 문법PHP 기초 문법
PHP 기초 문법
 
Programming Cascading
Programming CascadingProgramming Cascading
Programming Cascading
 

1. alps c c++

  • 1. ALPS C/C++ Study 2016. 3. 5 장 홍 준
  • 2. 목차 • 개요 • 함수 • 자료형 (int, char, bool, float, long long, double, array) • 조건문(if, else if, else, switch) • 순환문(for, while, do while) • 재귀호출 • 파일 입출력(FILE, freopen) • Standard Template Library - algorithm, vector, string, set, map • 다른 해더 파일 • 다음 시간에는 포인터 + 기본적인 알고리즘
  • 3. 개요 • 입력과 출력 • 그 사이의 연결고리 – 알고리즘 • 한정된 시간과 메모리 사용량
  • 4. 함수 void show(string s) { cout << s; } int hi(void) { show(“Hello World!n”); return 1; } int main(void) { if (hi(void)) show(“성공n”); else show(“실패n”); return 0; } 반환되는 자료형 / 함수의 인자(parameter) / 함수의 반환(리턴)값
  • 5. 자료형 http://msdn.microsoft.com/ko-kr/library/s3f49ktz.aspx %2d, %.2lf과 같은 출력 포맷 http://www.acmicpc.net/step/1 https://www.acmicpc.net/step/2
  • 6. 조건문 • If(A?) – else if(not A, not B, … , C?) – else • Switch (x) { case 0: a(); break; case 1: b(); break; default: c(); break; } https://www.acmicpc.net/step/4
  • 7. 순환문 for (시작 명령; 이행 조건; 추가 연산) { } while (이행 조건) { } do { } while(이행 조건);
  • 8. 재귀 호출 F(n) = F(n-1) + F(n-2) F(n-1) = F(n-2) + F(n-3) F(n-2) = F(n-3) + F(n-4) … F(1) = 1 F(n-2) = … 했던 계산을 또 안 하면 순환문과 같은 속도
  • 10. Standard Template Library • #include <algorithm> : sort, reverse • #include <vector> : dynamic array • #include <string> : string • #include <set> : balanced binary search tree • #include <map> : balanced binary search tree
  • 11. 다른 해더 파일 • #include <string.h> : strlen, memset • #include <math.h> : sin, cos, asin, acos, tan, atan, sqrt, hypot • #include <stdlib.h> : ?.... • #include <time.h> : clock
  • 12. 끝 acmicpc.net에서 연습하다가 문제 발생 → 알프스 톡방에 질문하기 좋은 주말 보내세요.