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); } } } }
4 Respostas
+ 2
đ„đ©âđ» Kintu Michael Evans đ„đ„
Check this condition inside loop.
for(int i = 1; i <= n; i++) {
if(i % 3 == 0)
//*;
else
//i;
}
+ 1
đ„đ©âđ» Kintu Michael Evans đ„đ„ Check my reply again. Edited
0
Help me to spot a mistake
0
đ„đ©âđ» Kintu Michael Evans đ„đ„
for(int i = 1; i <= n; i++) {
if(i % 3 == 0)
Console.Write("*");
else
Console.Write(i);
}