1. "What a nice smell!," the man said.

2. "What a nice smell," the man said.
3. "What a nice smell!" the man said.

(Which one is grammatically correct? It is about punctuation mark?)

#3 is correct; the others have punctuation issues.

Because "What a nice smell" is something you would say with excitement, #3 is correct. If it were another quote like, "I like your shirt," it could look like #1 or #3 because it could be meant enthusiastically (exclamation) or not (declarative).

All three sentences are grammatically correct, but they have different meanings depending on the punctuation used.

1. "What a nice smell!," the man said.
This sentence implies that the man said the words "What a nice smell!" with an exclamation and then used a comma to separate the speech tag "the man said."

2. "What a nice smell," the man said.
This sentence suggests that the man simply stated "What a nice smell" without any particular emphasis or exclamation. The statement is followed by a comma to separate the speech tag "the man said."

3. "What a nice smell!" the man said.
This sentence indicates that the man said "What a nice smell!" with an exclamation and is followed by an exclamation mark. There is no comma as it directly connects the speech tag "the man said."

So, the choice of punctuation changes the emphasis and meaning of the sentence, but all three versions are grammatically correct.

All three versions of the sentence you provided are grammatically correct, but the difference lies in the use of punctuation. Let me explain:

1. "What a nice smell!," the man said.
This version places a comma before the closing quotation mark, which is incorrect. In this case, the exclamation mark should be inside the quotation marks, like in the next two versions.

2. "What a nice smell," the man said.
This version uses a comma to separate the statement from the attribution phrase ("the man said"). This is the correct punctuation choice when including a dialogue tag like "the man said." However, it does not include any punctuation after the word "smell," such as an exclamation mark.

3. "What a nice smell!" the man said.
This version uses an exclamation mark inside the quotation marks to convey the man's excitement. It does not include a comma before the closing quotation mark because there is no dialogue tag like "the man said."

Therefore, the most appropriate grammatically correct version for expressing excitement or surprise about the smell would be option 3: "What a nice smell!" the man said.