THC reading (c + +)

Source: Internet
Author: User

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 + +)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.