Page 1 of 1

Please use C language Introduction: Input: Output: Example:

Posted: Mon Mar 21, 2022 4:51 pm
by answerhappygod
Please use C language
Introduction:
Please Use C Language Introduction Input Output Example 1
Please Use C Language Introduction Input Output Example 1 (38.19 KiB) Viewed 55 times
Input:
Please Use C Language Introduction Input Output Example 2
Please Use C Language Introduction Input Output Example 2 (12.36 KiB) Viewed 55 times
Output:
Please Use C Language Introduction Input Output Example 3
Please Use C Language Introduction Input Output Example 3 (4.58 KiB) Viewed 55 times
Example:
Please Use C Language Introduction Input Output Example 4
Please Use C Language Introduction Input Output Example 4 (15.04 KiB) Viewed 55 times
Given n strings, each of which consists of m uppercase letters, your task is to sort them in ascending order according to the following comparison method. If the first position that string a and string b differs is i, then a is smaller than biff 1. i is odd and a; <bi, or 2. i is even and ai > bi. The comparison of a¡ and bị follows A<B<C<D< ... <Z. An example: AC < AB < AA <BC<BB <BA.
Two numbers in the first line: n and m (1 <nim < 106). The following n lines gives n strings that are pairwise distinct.
The indices of the strings after sorting.
Input: 54 AAAA AABB AABC ABAA BACC Output: 413 2 5 (ABAA < AAAA< AABC < AABB < BACC)