We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
lol guys this is what i did import java.util.Scanner;
public class Solution {
static void f1(String s){
// String s = "cpp 65";
String[] parts = s.split(" ");
String str = parts[0];
String num = parts[1];
String fin = "";
if (num.length()==2){
fin = "0" + num;
}
else if (num.length()==1){
fin = "00" + num;
}
else {
fin = num;
}
int space = 15-str.length();
String gap = "";
for(int i=0;i
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Output Formatting
You are viewing a single comment's thread. Return to all comments →
lol guys this is what i did import java.util.Scanner;
public class Solution { static void f1(String s){ // String s = "cpp 65"; String[] parts = s.split(" "); String str = parts[0]; String num = parts[1]; String fin = ""; if (num.length()==2){ fin = "0" + num; } else if (num.length()==1){ fin = "00" + num; } else { fin = num; } int space = 15-str.length(); String gap = ""; for(int i=0;i