File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ import java .io .BufferedReader ;
2+ import java .io .IOException ;
3+ import java .io .InputStreamReader ;
4+ import java .util .StringTokenizer ;
5+
6+ public class BOJ_B2_10539_수빈이와수열 {
7+
8+ public static void main (String [] args ) throws IOException {
9+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
10+ StringBuilder sb = new StringBuilder ();
11+
12+ int N = Integer .parseInt (br .readLine ());
13+ long sum = 0 ;
14+
15+ StringTokenizer st = new StringTokenizer (br .readLine ());
16+ for (int i = 1 ; i <= N ; i ++) {
17+ int n = Integer .parseInt (st .nextToken ());
18+
19+ long a = (long )n * i - sum ;
20+ sum += a ;
21+
22+ sb .append (a ).append (' ' );
23+ }
24+
25+ sb .setLength (sb .length ()-1 );
26+ System .out .println (sb .toString ());
27+
28+ }
29+
30+ }
You can’t perform that action at this time.
0 commit comments