import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Reading input URL
String url = scanner.nextLine().trim();
// Extracting parameters and their values
String[] parts = url.split("\\?");
String[] params = parts[1].split("&");
// Printing parameters and their values
for (String param : params) {
String[] keyValue = param.split("=");
System.out.println(keyValue[0] + ": " + keyValue[1]);
}
}
}
No comments:
Post a Comment