Question: C Programming Language ( Code With C Programming Language) Problem Title : Plant Sorting Lili is a Biology student who was assigned by her lecturer

C Programming Language ( Code With C Programming Language)

Problem Title : Plant Sorting

Lili is a Biology student who was assigned by her lecturer to make a list of Latin plant names that can be found in the forest near the university. When in the forest, Lili found mushrooms and then went home cooking it. Apparently, the fungus that Lili ate cause food poisoning that made her hallucinate and difficult completing her work. Lili gives you a list of plants and asks for your help to sort them so that the list of plants given to her lecturer is sorted according to the A-Z alphabet.

Format Input

Read from file testdata.txt. First line, consists of one integer N, number of plants. Next N lines consists of two field per line which are plant number R and plants name M. The fields are separated by #.

Format Output

Output should be expressed in format R M - sorted by M in Ascending Order.

Constraints

  • 1 N 1000
  • 1 R 1000000
  • 1 |M| 40
  • M only consists of letters a-z and A-Z and spaces.

Sample Input (testdata.txt)

10 901#Smallanthus sonchifolius 902#Yucca aloifolia 903#Olea europea 904#Zebrina pendula 905#Sasa fortunei 906#Bambusa jacobsii 907#Phycalis peruviana 908#Gendarusa vulgaris 909#Dimocarpus longan 910#Lichi chinensis

Sample Output (Standard Output)

906 Bambusa jacobsii 909 Dimocarpus longan 908 Gendarusa vulgaris 910 Lichi chinensis 903 Olea europea 907 Phycalis peruviana 905 Sasa fortunei 901 Smallanthus sonchifolius 902 Yucca aloifolia 904 Zebrina pendula

Tips

You Can Use Struct to Solve this Problem More Easy.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!