The static void Main (string [] args)
{
String s=Console. ReadLine ();
String [] x=s.S plit (new char [] {'}, StringSplitOptions. RemoveEmptyEntries;
Int. Price=the Convert ToInt32 (x [0]);
Int discount=the Convert. ToInt32 (x [1]);
Double newPrice=price * (discount/100);
String k=newPrice. ToString ();
Console. WriteLine (k);
//the Console. WriteLine (String Format (" {0: N2} ", k));
The Console. ReadKey ();
}
CodePudding user response:
Post your debug screen, whether you in the watch window or debug debugging command window?CodePudding user response:
Programming will be subject to testing, rather than pure entangled what logic to ask "why?" .CodePudding user response:
Var userData="https://bbs.csdn.net/topics/aa bb cc dd ee";Var arr=userData. The Split (");
{foreach (var STR in arr)
Console. WriteLine (STR);
//if you want to turn int, you can use the var I=int. Parse (STR);
//on the safe side, you can use the int. J TryParse (), the reference function prototype, here not wordy.
}
CodePudding user response:
Bosses, the picture is debugging, you see, I see a lot of online example, to now also didn't want to understand
CodePudding user response:
Power on int price=the Convert. ToInt32 (x [0]);Check the value of s
CodePudding user response: