Biblioteca Java - Blame information for rev 4
Subversion Repositories:
Rev | Author | Line No. | Line |
---|---|---|---|
4 | mihai | 1 | package introducere.java; |
2 | |||
3 | import java.io.*; | ||
4 | |||
5 | public class CitesteIntregi { | ||
6 | public static void main(String[] args) throws Exception{ | ||
7 | BufferedReader t = new BufferedReader(new InputStreamReader(System.in)); | ||
8 | int[] a = new int[10]; | ||
9 | |||
10 | System.out.println("Introduceti 10 numere intregi!"); | ||
11 | |||
12 | for(int i=0;i<a.length;i++){ | ||
13 | String s = t.readLine(); | ||
14 | int x = Integer.parseInt(s); | ||
15 | a[i] = x; | ||
16 | } | ||
17 | |||
18 | int sum = 0; | ||
19 | for(int i=0;i<a.length;i++){ | ||
20 | sum = sum + a[i]; | ||
21 | } | ||
22 | |||
23 | int y = 9; | ||
24 | |||
25 | System.out.println("SUMA ESTE:"+sum); | ||
26 | |||
27 | } | ||
28 | } |