Problem Description
There are multiple file names separated by semicolons with suffixes (for example, 1.xml20.2.20.3.jpg00004.txt). You can write a C program to find the first file name that meets the suffix requirements and display the file type.
The specified suffixes and file types correspond to the following:
Voice: type 1, suffix wav;
Video: type 2, suffix 3gp;
Fax: Type 3, suffix tif;
Image: Type 4, suffix jpg;
Text: type 5, suffix txt.
For version 1.xml00002.000000003.jpg00004.txt, the program outputs the file name "3.jpg" and type "4 ". That is, 3.jpg is the first file name that meets the suffix requirements. The file type is "4" (image ).
C program implementation
Program output result
Later, the program finds the first filename extension named 3.jpg. The file type is "4" (image ).
Find the first file name that meets the suffix requirements and C program implementation of its type