mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-07 18:06:58 +08:00
Add FZOI Codes
This commit is contained in:
31
FZOI/字符数组合并 .cpp
Normal file
31
FZOI/字符数组合并 .cpp
Normal file
@ -0,0 +1,31 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int arr[100005];
|
||||
|
||||
int main()
|
||||
{
|
||||
int cnt = 0;
|
||||
char ch;
|
||||
while(cnt < 2)
|
||||
{
|
||||
ch = getchar();
|
||||
|
||||
if(ch == '.')
|
||||
{
|
||||
cnt ++ ;
|
||||
}
|
||||
if(ch >= 'a' && ch <= 'z')
|
||||
{
|
||||
arr[ch] ++ ;
|
||||
}
|
||||
}
|
||||
for(int i = 97; i <= 121; ++ i)
|
||||
{
|
||||
for(int j = 1; j <= arr[i]; ++ j)
|
||||
{
|
||||
cout << (char)i ;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user