c# - How to display output in single line -


my program generating output, expecting different output generated. if send 6 input numbers, should compare numbers , generate answer.

using system; using system.collections.generic; using system.io; using system.linq;  class solution  {     static void main(string[] args)      {         string[] tokens_a0 = console.readline().split(' ');          int a0 = convert.toint32(tokens_a0[0]);         int a1 = convert.toint32(tokens_a0[1]);         int a2 = convert.toint32(tokens_a0[2]);          string[] tokens_b0 = console.readline().split(' ');          int b0 = convert.toint32(tokens_b0[0]);         int b1 = convert.toint32(tokens_b0[1]);         int b2 = convert.toint32(tokens_b0[2]);          if (a0 > b0 || a0 < b0)         {             console.writeline(1);         }         if (a1 > b1 || a1 < b1)         {             console.writeline(1);         }         if (a2 > b2 || a2 < b2)         {             console.writeline(1);         }     } } 

the code above generating following output:

1

1

i need output display instead:

1 1

how can change code generate output in manner?

console.writeline name says, writes message, followed new line.

if want output in same line, should use console.write:

if (a0 > b0 || a0 < b0) {    console.write(1 + " "); } if (a1 > b1 || a1 < b1) {     console.write(1 + " "); } if (a2 > b2 || a2 < b2) {     console.write(1 + " "); } 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -