SIr if online Judges Just Check correct output sample and output file produced by ours submitted code than there maybe possibility that the problem is pattern and the pattern is printed directly using count instead pof while loop the output file produced will be same as the correct output so the code will be accepted isnt it??
Online judges code submit
@tejasddongare yes using cout you can directly code the output but whats the point also testcases are not shown . if your doubt is cleared dont forget to hit like and mark resolved 