Author : Jisan
Programming language : Java
Difficulty : Easy
Status : Accepted
Problem number : UVA-483
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=424
Help: http://docs.oracle.com/javase/7/docs/api/java/io/BufferedReader.html and http://docs.oracle.com/javase/7/docs/api/java/util/StringTokenizer.html
Code:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Uva_483 {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String tomato="";
int i=0;
while(!((tomato=bf.readLine())==null)){
String[] jisan=tomato.split(" ");
for(i=0;i<jisan.length;i++){
System.out.print(new StringBuffer(jisan[i]).reverse()+(i==jisan.length-1 ? "\n": " "));
}
}
}
}
Programming language : Java
Difficulty : Easy
Status : Accepted
Problem number : UVA-483
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=424
Help: http://docs.oracle.com/javase/7/docs/api/java/io/BufferedReader.html and http://docs.oracle.com/javase/7/docs/api/java/util/StringTokenizer.html
Code:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Uva_483 {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String tomato="";
int i=0;
while(!((tomato=bf.readLine())==null)){
String[] jisan=tomato.split(" ");
for(i=0;i<jisan.length;i++){
System.out.print(new StringBuffer(jisan[i]).reverse()+(i==jisan.length-1 ? "\n": " "));
}
}
}
}
No comments:
Post a Comment