Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": "\uAD6C\uC131 \uC5C6\uC74C"
}
11 changes: 11 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"ExpandedNodes": [
"",
"\\submission",
"\\submission\\excercise-01",
"\\submission\\excercise-01\\shintaewon",
"\\submission\\excercise-01\\shintaewon\\exercise01"
],
"SelectedNode": "\\submission\\excercise-01\\shintaewon\\exercise01\\exercise01.cpp",
"PreviewInSolutionExplorer": false
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .vs/moderncpp_exercise_0/v17/.wsuo
Binary file not shown.
Binary file added .vs/moderncpp_exercise_0/v17/Browse.VC.db
Binary file not shown.
Binary file not shown.
Binary file added .vs/slnx.sqlite
Binary file not shown.
30 changes: 30 additions & 0 deletions submission/excercise-01/shintaewon/ConsoleApplication1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <iostream>
#include<list>

using namespace std;

int main()
{
//리스트 선언
list<int> nums_list;

int temp_num, a, b;

//뒤쪽으로 요소 추가하기
for (int i = 0; i < 10; i++) {
cin >> temp_num;
nums_list.push_back(temp_num);
}

cin >> a >> b;

int bigger = max(a, b);
int smaller = min(a, b);

auto it1 = find(nums_list.begin(), nums_list.end(), smaller+1);

auto it2 = find(nums_list.begin(), nums_list.end(), bigger+1);
nums_list.erase(it1, it2);

copy(nums_list.begin(), nums_list.end(), ostream_iterator<int>(cout, " "));
}
58 changes: 58 additions & 0 deletions submission/excercise-02/shintaewon/exercise02.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include <iostream>
#include <algorithm>
#include<vector>

using namespace std;

int main()
{
//리스트 선언
vector<int> nums_vec;
vector<int> nums_vec_cpy;

int temp_num, a;
bool flag = false;

//뒤쪽으로 요소 추가하기
for (int i = 0; i < 10; i++) {
cin >> temp_num;
nums_vec.push_back(temp_num);
nums_vec_cpy.push_back(temp_num);
}
cin >> a;

auto it = find(nums_vec.begin(), nums_vec.end(), a);

if (it != nums_vec.end()) { // vector내에 a 존재함
cout << it - nums_vec.begin(); // index 확인
flag = true;
}

sort(nums_vec.begin(), nums_vec.end());

if (flag == false) {
int cnt = 0;
while (cnt < nums_vec.size()) {

if (a < nums_vec[cnt]) {//a가 만약 인덱스보다 크다면?

auto it = find(nums_vec_cpy.begin(), nums_vec_cpy.end(), nums_vec[cnt]);

if (it != nums_vec_cpy.end()) { // vector내에 a 존재함
cout << it - nums_vec_cpy.begin(); // index 확인
flag = true;
}

flag = true;
break;
}
else {
cnt++;
}
}
}

if (flag == false) {
cout << -1;
}
}
Empty file added submission/shintaewon.txt
Empty file.