0

C# to C++

How can I convert this code from C# to C++? using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ProgramozásiTételek_Kiválogatás { class EgyszerreNagyMennyiségbenMegvettTeák { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); List<string> teak = new List<string>(); for (int i = 0; i < n; i++) { string tea = Console.ReadLine(); int menny = int.Parse(Console.ReadLine()); if (menny > 500) teak.Add(tea); } if (teak.Count == 0) Console.WriteLine(0); else { Console.Write(teak.Count + " "); for (int i = 0; i < teak.Count; i++) { Console.Write(teak[i]); if (i < teak.Count - 1) Console.Write(" "); } Console.WriteLine(); } } } }

20th Oct 2018, 7:44 PM
Geri
Geri - avatar
2 Respostas
+ 4
Basically, you need to know two things: C++ syntax equivalent to the C# and C++ variables, functions, and properties equivalent to the C#. It isn't very hard. In fact I've converted a language I didn't know to one I did. I know you are just starting the C++ course. Do you know C#?
20th Oct 2018, 11:27 PM
John Wells
John Wells - avatar
+ 1
I expected you to ask for the code to be converted so did so. If you want to see it, check here: https://code.sololearn.com/cC93zGf940Hb
22nd Oct 2018, 1:58 PM
John Wells
John Wells - avatar