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); } } }
3 odpowiedzi
+ 6
Уалихан Мукашев ,
there is a typo, it has to be :
double radius = Convert.ToDouble(Console.ReadLine());
^ the dot was missing
+ 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());
+ 1
Thank you, I understand what the error is. I was not careful and missed the point. Sorry for my English)