/* package whatever; // don't place package name! */
import java.util.* ;
import java.lang.* ;
import java.io.* ;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
getQuestion( ) ;
}
public static String getQuestion
( ) { Scanner input
= new Scanner
( System .
in ) ; System .
out .
print ( "Ask any question you need answered and prepare yourself for the sage advice of......your computer.\n Just type \" exit\" when you can't handle the truth any longer.\n Question: " ) ; String question
= input.
nextLine ( ) ; while ( ! question.equals ( exit) ) {
showAnswer( ) ;
System .
out .
print ( "Question: " ) ; question = input.nextLine ( ) ;
}
return question;
}
public static void showAnswer ( ) {
int answer
= ( int ) ( Math .
random ( ) * 10 ) ; switch ( answer) {
case 0 : System .
out .
println ( "1" ) ; break ; case 1 : System .
out .
println ( "2" ) ; break ; case 2 : System .
out .
println ( "3" ) ; break ; case 3 : System .
out .
println ( "4" ) ; break ; case 4 : System .
out .
println ( "5" ) ; break ; case 5 : System .
out .
println ( "6" ) ; break ; case 6 : System .
out .
println ( "7" ) ; break ; case 7 : System .
out .
println ( "8" ) ; break ; case 8 : System .
out .
println ( "9" ) ; break ; case 9 : System .
out .
println ( "10" ) ; break ; }
return ;
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCWdldFF1ZXN0aW9uKCk7Cgl9CgkKCXB1YmxpYyBzdGF0aWMgU3RyaW5nIGdldFF1ZXN0aW9uICgpIHsKICAgICAgICBTY2Fub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GJyZWFrOwogICAgICAgICAgICBjYXNlIDQ6U3lzdGVtLm91dC5wcmludGxuICgiNSIpOyBicmVhazsKICAgICAgICAgICAgY2FzZSA1OlN5c3RlbS5vdXQucHJpbnRsbiAoIjYiKTsgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgNjpTeXN0ZW0ub3V0LnByaW50bG4gKCI3Iik7IGJyZWFrOwogICAgICAgICAgICBjYXNlIDc6IFN5c3RlbS5vdXQucHJpbnRsbiAoIjgiKTsgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgODogU3lzdGVtLm91dC5wcmludGxuICgiOSIpOyBicmVhazsKICAgICAgICAgICAgY2FzZSA5OiBTeXN0ZW0ub3V0LnByaW50bG4gKCIxMCIpOyBicmVhazsKICAgICAgICB9CiAgICAgICAgcmV0dXJuOwogICAgfQp9