What's the difference between cout << "\n" and cout << '\n'?
cout << "Optimal train swapping takes " << cnt << " swaps." << '\n';
Give the wrong answer

Then I try the code that end with "\n", it correct.
cout << "Optimal train swapping takes " << cnt << " swaps." << "\n";

Is there any reason that make the different?