Argentina | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Argentina

All but the final test case is correct 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) { int pesos = Convert.ToInt32(Console.ReadLine()); int dollars = Convert.ToInt32(Console.ReadLine()); int convertedDollars = dollars * 50; if (convertedDollars < pesos) { Console.Write("Dollars"); } else { Console.Write("Pesos"); } } } }

5th Sep 2020, 11:36 PM
Aidan
Aidan - avatar
2 Answers
+ 2
Aidan look up Convert.ToDouble and Math.Round
6th Sep 2020, 3:55 AM
Paul K Sadler
Paul K Sadler - avatar
0
Aidan there may multiplication cause overflow of Integer range, so try by convertedpesos approache of using division instead of converted dollars.. So above, you have 2 alternatives approaches..
6th Sep 2020, 11:33 AM
Jayakrishna 🇮🇳