0

Help me with this code coach

It fails all test cases Here is the code using System.Collections.Generic; namespace SoloLearn { class Program { static void Main(string[] args) { int n = Convert.ToInt32(Console.ReadLine()); //your code goes here if (n%3 == 0) { Console.WriteLine("*"); } else { Console.WriteLine(n); } } } }

16th Dec 2020, 7:17 PM
đŸ„‡đŸ‘©â€đŸ’» Kintu Michael Evans đŸ”„đŸ”„( Active)
đŸ„‡đŸ‘©â€đŸ’» Kintu Michael Evans đŸ”„đŸ”„( Active) - avatar
4 Respostas
+ 2
đŸ„‡đŸ‘©â€đŸ’» Kintu Michael Evans đŸ”„đŸ”„ Check this condition inside loop. for(int i = 1; i <= n; i++) { if(i % 3 == 0) //*; else //i; }
16th Dec 2020, 7:21 PM
AÍąJ
AÍąJ - avatar
16th Dec 2020, 7:24 PM
AÍąJ
AÍąJ - avatar
0
Help me to spot a mistake
16th Dec 2020, 7:23 PM
đŸ„‡đŸ‘©â€đŸ’» Kintu Michael Evans đŸ”„đŸ”„( Active)
đŸ„‡đŸ‘©â€đŸ’» Kintu Michael Evans đŸ”„đŸ”„( Active) - avatar
0
đŸ„‡đŸ‘©â€đŸ’» Kintu Michael Evans đŸ”„đŸ”„ for(int i = 1; i <= n; i++) { if(i % 3 == 0) Console.Write("*"); else Console.Write(i); }
16th Dec 2020, 7:26 PM
AÍąJ
AÍąJ - avatar