Trying to solve beecrowd 1001 problems. But receiving wrong answer message!!

22 views
Skip to first unread message

Khandokar Faisal Islam

unread,
Jun 14, 2022, 2:52:46 AMJun 14
to Dart Misc
Screenshot 2022-06-14 121757.png

Jacob Bang

unread,
Jun 14, 2022, 3:01:00 AMJun 14
to mi...@dartlang.org
Please don't post code as only screenshot since it makes it rather annoying for us to try reproduce your issue.

Also, please describe what answer you are getting and what answer you was expecting. Also what input you have provided since we can't see that.

Den tir. 14. jun. 2022 kl. 08.52 skrev Khandokar Faisal Islam <faisa...@gmail.com>:
Screenshot 2022-06-14 121757.png

--
For more ways to connect visit https://dart.dev/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/01f44a60-b3dc-435c-885c-07c021c045f0n%40dartlang.org.


--
Jacob Bang / julemand101

Khandokar Faisal Islam

unread,
Jun 14, 2022, 5:39:56 AMJun 14
to Dart Misc, julem...@gmail.com
I was trying to solve this problem with dart program 


The formula to calculate the area of a circumference is defined as A = π . R2. Considering to this problem that π = 3.14159:

Calculate the area using the formula given in the problem description.

Input

The input contains a value of floating point (double precision), that is the variable R.

Output

Present the message "A=" followed by the value of the variable, as in the example bellow, with four places after the decimal point. Use all double precision variables. Like all the problems, don't forget to print the end of line after the result, otherwise you will receive "Presentation Error".


Here is my code:


import 'dart:io';
import 'dart:core';

import 'dart:math';

void main() {
  double R = double.parse(stdin.readLineSync());
  double n = 3.14159;
  double A = n * (pow(R, 2));
  print("A= ${(A).toStringAsFixed(4)}");
}




Jacob Bang

unread,
Jun 14, 2022, 6:48:03 AMJun 14
to Khandokar Faisal Islam, Dart Misc
Forgot to answer the group. But the solution was to remove the extra
space added by accident after "=" in the generated output:

import 'dart:io';
import 'dart:core';

import 'dart:math';

void main() {
double R = double.parse(stdin.readLineSync());
double n = 3.14159;
double A = n * (pow(R, 2));
print("A=${(A).toStringAsFixed(4)}");
}

Den tir. 14. jun. 2022 kl. 10.09 skrev Khandokar Faisal Islam
Reply all
Reply to author
Forward
0 new messages