Skip to content

Commit

Permalink
Create 1152_단어의개수_sort.cpp file
Browse files Browse the repository at this point in the history
  • Loading branch information
witheunjin committed Aug 16, 2020
1 parent c1567ed commit de84968
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions BaekJoon/1152_단어의개수_sort.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
string input;
getline(cin, input);
int blank = 0;
if(input[0] == ' ') blank --;
if(input[input.length()-1] == ' ') blank--;
sort(input.begin(), input.end());
for(int i=0; i<input.length(); i++) {
if(input[i] == ' ') blank++;
else break;
}
cout << blank + 1;
return 0;
}
2 changes: 1 addition & 1 deletion BaekJoon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ https://www.acmicpc.net/
|**2798**|**블랙잭**|2020.04.26|1|
|**1330**|**두 수 비교하기**|2020.04.26|1|
|**14681**|**사분면 고르기**|2020.04.26|1|
|****|****|||
|**1152**|**단어의 개수**|2020.08.16|1|
|****|****|||
|****|****|||
|****|****|||
Expand Down

0 comments on commit de84968

Please sign in to comment.