-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.java
More file actions
28 lines (25 loc) · 702 Bytes
/
Main.java
File metadata and controls
28 lines (25 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Task {
void solve( int ri, InputReader in, PrintWriter out ) {
BigDecimal a = new BigDecimal("23213432.2142143");
a = a.round( new MathContext(10, RoundingMode.HALF_UP) );
out.println( a.toPlainString() );
}
}
class InputReader {
private BufferedReader reader;
private StringTokenizer tokenizer;
public InputReader( InputStream sm ) {
reader = new BufferedReader( new InputStreamReader(sm) );
tokenizer = null;
}
public String next() {
while ( tokenizer == null || !tokenizer.hasMoreTokens() ) {
try {
tokenizer = new StringTokenizer( reader.readLine() );
} catch( IOException e ) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
}