URI Scheme
Submit solution
Points:
10
Time limit:
5.0s
Memory limit:
256M
Author:
Problem type
Allowed languages
C#, Go, Java, Python
Completa la classe URL
i el mètode main()
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
class URL {
String protocol;
String domain;
String path;
String query;
String fragment;
// escriu codi aqui
}
public class E11 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
URL url = new URL();
// escriu codi aqui
System.out.println(url);
}
}
Input Format
La entrada consta de 5 línies:
- protocol
- domain
- path
- query
- fragment
Constraints
-
Output Format
S'imprimirà la URL ben formada.
Sample Input 0
http
www.mydomain.com
/path/to
query=true
fragment1
Sample Output 0
http://www.mydomain.com/path/to?query=true#fragment1
Sample Input 1
https
anotherdomain.cat
/path/to/page
q=1&s=1
frag
Sample Output 1
https://anotherdomain.cat/path/to/page?q=1&s=1#frag
Sample Input 2
https
domainname.org
/document
t=www&s=1
new
Sample Output 2
https://domainname.org/document?t=www&s=1#new
Autoria: Gerard Falcó
CC BY-NC-SA 4.0