| thc reading |
| difficulty level: B; run time limit: 64ms; run Space limitation: 256000KB; Code length limitation: 2000000B |
| question description |
| THC was always a hapless (and clever) Child's paper, and today she sat under an apple tree reading, because she fell Mildew so there are a lot of apples from the tree fell to her head, but also bad friends to her throwing apples (only throw one, difficulty -0.001) (ˇ?ˇ). Now she counted a total of n apples fell to the ground, and made a letter for each apple, and ordered them in dictionary order (really boring, difficulty +0.000000001), But she did not know that the friend threw her Apple should be inserted where, now please help her. |
| input |
The first row has an n, which means that n apples fall from the Tree. The second row has n lowercase letters, which represent the number of apples falling from the Tree. The third line has only one lowercase letter, which represents the one the friend threw to her. |
| output |
| A string length of n+1 that represents the sequence after inserting the Apple. |
| Input Example |
9 Bcehijrzz F |
| Sample Output |
| bcefhijrzz |
| Additional Instructions |
| hint: LJX think n will not exceed 26 (everyone Knows) Remember to use linked list Oh. |
| |
#include <iostream>
#include <algorithm>
Using namespace std;
int main ()
{
Char a[26];
int n,i;
cin>>n;
For (i=0;i<=n;i++) cin>>a[i];
Sort (a,a+n+1);
For (i=0;i<=n;i++) cout<<a[i];
}
THC reading (c + +)