Sometimes i can be a bit perfectionist, take a look at my code:
public static void print3(String s) {
System.out.print(s + " " + s);
System.out.print(" " + s + " ");
}
The output => [window window window file file file ]
Yes there is a single space at the end, although the answer is correct, i feel the need to remove the unneeded space.
My friend, do u have any idea?
My answer is correct, but instead i need to remove the space on the last sentence
Under discussion
Comments (5)
- Popular
- New
- Old
You must be signed in to leave a comment
Bashimgeldi Kurbanov
14 April 2019, 23:41
public class Solution {
public static void print3(String s) {
for (int x = 0; x < 3; x++){
System.out.print (s +" ");
}
}
0
past cham
9 March 2019, 16:16
System.out.print(s + "\t");
System.out.print(s + "\t");
System.out.print(s + "\t");
0
De'em De Mesa
8 March 2019, 21:17
Check out this...it could help
System.out.print(s+" ");
System.out.print(s+" ");
System.out.println(s);
0
vineeth
21 February 2019, 15:01
//write your code here
System.out.print(s);
System.out.print(" ");
System.out.print(s);
System.out.print(" ");
System.out.print(s);
0
Khurram
10 February 2019, 14:57
why don't you type
+2