0

Why this code don't work in Sololearn, but work in VSCode?

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { const double pi = 3.14; double radius = ConvertToDouble(Console.ReadLine()); Console.WriteLine(pi*radius*radius); } } }

24th Nov 2021, 8:53 AM
Уалихан Мукашев
3 odpowiedzi
+ 6
Уалихан Мукашев , there is a typo, it has to be : double radius = Convert.ToDouble(Console.ReadLine()); ^ the dot was missing
24th Nov 2021, 10:37 AM
Lothar
Lothar - avatar
+ 4
Was there any error message from VSCode? if so what was it? and on which line? I think your code was missing a '.' between `Convert` and `ToDouble` in the line where you read input for <radius> double radius = Convert.ToDouble(Console.ReadLine());
24th Nov 2021, 9:10 AM
Ipang
+ 1
Thank you, I understand what the error is. I was not careful and missed the point. Sorry for my English)
24th Nov 2021, 9:47 AM
Уалихан Мукашев