끄적끄적 코딩
article thumbnail
[C++] 백준 2741번 N 찍기
알고리즘 2019. 3. 5. 01:21

for문을 사용하여 풀었습니다. #include using namespace std; int main(int argc, char *argv[]) { int n; cin >> n; for(int i=0; i

article thumbnail
[C++] 백준 2558번 A+B - 2
알고리즘 2019. 3. 5. 01:08

단순한 덧셈 문제입니다. #include using namespace std; int main(int argc, char *argv[]) { int a, b; cin >> a; cin >> b; cout

article thumbnail
[C++] 백준 10430번 나머지
알고리즘 2019. 3. 5. 00:58

문제에 있는 연산을 그대로 입력하여 출력하였습니다. #include using namespace std; int main(int argc, char *argv[]) { int a, b, c; cin >> a; cin >> b; cin >> c; cout

article thumbnail
[C++] 백준 10869번 사칙연산
알고리즘 2019. 3. 5. 00:37

입력받은 두 자연수의 합, 차, 곱, 몫, 나머지를 출력하는 문제입니다. #include using namespace std; int main(int argc, char* argv[]) { int a, b; cin >> a; cin >> b; cout

article thumbnail
[C++] 백준 1008번 A/B
알고리즘 2019. 3. 5. 00:35

cout.precision을 이용해서 소수점 10자리까지 출력하게 하였습니다. #include using namespace std; int main() { double A, B; cin >> A >> B; cout.precision(10); cout

article thumbnail
[C++] 백준 10998번 AxB
알고리즘 2019. 3. 5. 00:25

입력받은 두 값의 곱을 출력하는 문제입니다. #include using namespace std; int main(int argc, char* argv[]) { int a, b; cin >> a; cin >> b; cout

article thumbnail
[C++] 백준 11719번 그대로 출력하기 2
알고리즘 2019. 3. 5. 00:20

입력받고 출력하는 과정을 100번 반복하였습니다. #include #include using namespace std; int main(int argc, char * argv[]) { string s; for(int i=0; i

article thumbnail
[C++] 백준 11718번 그대로 출력하기
알고리즘 2019. 3. 5. 00:13

입력받은대로 출력하는 문제입니다. getline 함수로 줄을 받아와서 s에 넣습니다. 그리고 s를 출력하는 작업을 반복합니다. 공백이 입력 되었을때 while문이 종료하게 됩니다. #include #include using namespace std; int main(int argc, char *argv[]) { string s= " "; while(s != ""){ getline(cin, s); cout

검색 태그