using System;
public class Test
{
public static void Main()
{
var roundedA = Math.Round(1.1, 0); // Output: 1
var roundedB = Math.Round(1.5, 0, MidpointRounding.AwayFromZero); // Output: 2
var roundedC = Math.Round(1.9, 0); // Output: 2
var roundedD = Math.Round(2.5, 0); // Output: 2
var roundedE = Math.Round(2.5, 0, MidpointRounding.AwayFromZero); // Output: 3
var roundedF = Math.Round(3.49, 0, MidpointRounding.AwayFromZero); // Output: 3
Console.WriteLine("A: " + roundedA);
Console.WriteLine("B: " + roundedB);
Console.WriteLine("C: " + roundedC);
Console.WriteLine("D: " + roundedD);
Console.WriteLine("E: " + roundedE);
Console.WriteLine("F: " + roundedF);
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFRlc3QKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCXZhciByb3VuZGVkQSA9IE1hdGguUm91bmQoMS4xLCAwKTsgLy8gT3V0cHV0OiAxCgkJdmFyIHJvdW5kZWRCID0gTWF0aC5Sb3VuZCgxLjUsIDAsIE1pZHBvaW50Um91bmRpbmcuQXdheUZyb21aZXJvKTsgLy8gT3V0cHV0OiAyCgkJdmFyIHJvdW5kZWRDID0gTWF0aC5Sb3VuZCgxLjksIDApOyAvLyBPdXRwdXQ6IDIKCQl2YXIgcm91bmRlZEQgPSBNYXRoLlJvdW5kKDIuNSwgMCk7IC8vIE91dHB1dDogMgoJCXZhciByb3VuZGVkRSA9IE1hdGguUm91bmQoMi41LCAwLCBNaWRwb2ludFJvdW5kaW5nLkF3YXlGcm9tWmVybyk7IC8vIE91dHB1dDogMwoJCXZhciByb3VuZGVkRiA9IE1hdGguUm91bmQoMy40OSwgMCwgTWlkcG9pbnRSb3VuZGluZy5Bd2F5RnJvbVplcm8pOyAvLyBPdXRwdXQ6IDMKCQlDb25zb2xlLldyaXRlTGluZSgiQTogIiArIHJvdW5kZWRBKTsKCQlDb25zb2xlLldyaXRlTGluZSgiQjogIiArIHJvdW5kZWRCKTsKCQlDb25zb2xlLldyaXRlTGluZSgiQzogIiArIHJvdW5kZWRDKTsKCQlDb25zb2xlLldyaXRlTGluZSgiRDogIiArIHJvdW5kZWREKTsKCQlDb25zb2xlLldyaXRlTGluZSgiRTogIiArIHJvdW5kZWRFKTsKCQlDb25zb2xlLldyaXRlTGluZSgiRjogIiArIHJvdW5kZWRGKTsKCX0KfQ==