Welcome Guest.

1Answers

C++ string

Asked by: Walter Anderson 210 views IT June 27, 2019

Title Description Description

gives a string a and an integer x. If the length n of the string is even, the interception string begins with the first character and ends with the n/2th character. Part of the string. If the length n of the string is an odd number, the string starting from the (n-1)/2+1th character to the end of the nth character is intercepted. After the string is truncated, the first x characters of the truncated string are deleted and output.

Enter a description of the Input Description

line, an integer and a string, xa

output description Output Description

The truncated character String

Sample Input Sample Input

2 abcdefghijkl

Sample Output Sample Output

cdef

Data Scope and prompts Data Size &Hint

n>2*x,n≤100

Addition: Try to write with functions, thank you, loop is difficult to understand

1 Answers

  1. +2Votes  

    C++ processing is a strong point in itself. This does not require looping or self-writing functions.

    The following is a reference

    Williams- June 28, 2019 |