#P7869. 「Wdoi-4」使用三个系统程度的能力
「Wdoi-4」使用三个系统程度的能力
Background
Erratum: In fact, since released in , the newline character has been . Many articles published online contain mistakes; the problem setter also believed them without checking in person. To prevent rumors from spreading further, this paragraph is placed here. The testdata still follows the current problem statement and has not been changed.
Hecatia Lapislazuli is a goddess with three bodies, ruling the hells of the Moon, the Earth, and the Otherworld. Because she formed an alliance with Junko, Hecatia came into contact with Gensokyo, as well as some modern technology.
Hecatia found that in human society there are three very common and popular operating systems: , , and . These three are like Hecatia’s three bodies, each taking a large share of the market.
But Hecatia also found that although files can be exchanged between these three systems in some ways, there are still differences—for example, the characters used for newlines. Hecatia is very interested in this.
Now Hecatia somehow got a text file from some system. She wants to know on which system this file was edited. Can you write a program to help her?
Problem Description
On , , and systems, three different newline conventions are used. Written as explicit escape sequences, they are , , and . Now there is a non-empty text file that has already been written (it contains only uppercase and lowercase English letters, underscores, Arabic digits, spaces, and newlines). This text file was written on a single system, so it is guaranteed that the newline sequences appear in only one of the three forms above.
For example, this is a valid text file:
SCP2021 J rp plus plus
chen zhe AK IOI
Welcome to Hell
Now replace its newlines with the corresponding escape sequences. Then, on the three systems, it would look like the following:
- system:
- system:
- system:
Your task is: given the converted text file, determine on which system this text file was written. For the three cases above, output windows, linux, or mac, respectively.
Input Format
There is one line of input: the converted text file. The text file is guaranteed to be non-empty, and before conversion it contains at least one newline. The input may contain spaces.
Output Format
Output one line with one lowercase word, indicating on which system this text file was written.
SCP2021RPplusplus\nchenzheAKIOI\n1plus1equalto2\n
linux
chen_zhe AK IOI\r\nchen_zhe AK NOI\r\n
windows
include iostream\rsigned main return 0\r
mac
Hint
Sample can be found in the attached files .
Constraints
- For of the testdata, it is guaranteed that there are no spaces.
- For of the testdata, the input string length is guaranteed to be . The input contains only uppercase English letters, lowercase English letters, underscores, digits, spaces, and escape characters (
\r,\n).
Note
In this problem, \n and \r mean a backslash character directly written in the input followed by a lowercase letter n or r, rather than a real escape character.
Translated by ChatGPT 5