We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The text was updated successfully, but these errors were encountered:
public static void es3(String s1, String s2, String s3) { String[] array = { s1, s2, s3 }; int maxlen = s1.length(); for (int i = 1; i < array.length; i++) { if (array[i].length() > maxlen) { maxlen = array[i].length(); } } StringBuilder output = new StringBuilder(); for (int i = 0; i < maxlen; i++) { if (i < s1.length()) { output.append(s1.charAt(i)); } else { output.append(" "); } if (i < s2.length()) { output.append(s2.charAt(i)); } else { output.append(" "); } if (i < s3.length()) { output.append(s3.charAt(i)); } else { output.append(" "); } output.append("\n"); } System.out.println(output); }
Sorry, something went wrong.
import java.util.Arrays; public class N2 { public static void stampaVerticale(String s1, String s2, String s3) { int max= Math.max( Math.max(s1.length(), s2.length()),s3.length()); char[] new_s1= Arrays.copyOf( s1.toCharArray(),max); char[] new_s2=Arrays.copyOf(s2.toCharArray(),max); char[] new_s3=Arrays.copyOf(s3.toCharArray(),max); for (int i=0;i<max;i++) { System.out.println(new_s1[i]+" " +new_s2[i]+" "+new_s3[i]); } } }
No branches or pull requests
The text was updated successfully, but these errors were encountered: