luyencode / comments

Server lưu trữ bình luận trên Luyện Code
https://luyencode.net
6 stars 3 forks source link

https://oj.luyencode.net/problem/EZCHUXH #705

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Chi tiết bài tập - undefined

https://luyencode.net/problem/EZCHUXH

ghost commented 2 years ago

Đây là lời giải của mình đã AC. Nếu bạn đã cố gắng mà chưa làm được thì có thể tham khảo lời giải của mình.

Xem code AC

``` #include #include #include int main() { std::string s; std::getline(std::cin, s); std::map m; for(auto &x : s) { if(isalpha(x)) { m[x]++; } } for(auto &x : m) { std::cout << x.first << ':' << x.second << "\n"; } return 0; } ```

hoangdev0 commented 1 year ago

Đây là lời giải của mình đã AC. C++.

Xem code AC

```c++ #include using namespace std; string s; vector v(150, 0); int main() { getline(cin, s); for (auto x : s) if (isalpha(x)) v[x]++; for (int i = 'A'; i <= 'z'; i++) if (v[i] > 0 && isalpha(char(i))) cout << char(i) << ":" << v[i] << endl; return 0; } ```

ThuanNqt commented 1 year ago

C++

Xem code AC

```cpp #include using namespace std; int main(){ string s;getline(cin,s); map mp; for(int i=0;i