Three Lines Apart
by CodeChum Admin
Do you like reading books? If you do, then you must have encountered texts that have quite a wide space with dots in between them, just like pausing or thinking before proceeding the narration. Let's try doing that here in Python, shall we?
Input
Two lines containing a string on each.
some string
another string
Output
The first line contains the first inputted string.
The next three lines contains a dot symbol on each.
The last line contains the second inputted string.
some string
.
.
.
another string
Solution:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String firstLine = scanner.nextLine(); // Read first line
String secondLine = scanner.nextLine(); // Read second line
System.out.println(firstLine); // Print first line
for (int i = 0; i < 3; i++) {
System.out.println("."); // Print dot in three lines
}
System.out.println(secondLine); // Print second lines
}
}
Comments
Leave a comment