Biblioteca Java - Rev 4
Subversion Repositories:
package introducere.java;
import java.io.*;
public class CitesteIntregi {
public static void main(String[] args) throws Exception{
BufferedReader t = new BufferedReader(new InputStreamReader(System.in));
int[] a = new int[10];
System.out.println("Introduceti 10 numere intregi!");
for(int i=0;i<a.length;i++){
String s = t.readLine();
int x = Integer.parseInt(s);
a[i] = x;
}
int sum = 0;
for(int i=0;i<a.length;i++){
sum = sum + a[i];
}
int y = 9;
System.out.println("SUMA ESTE:"+sum);
}
}
import java.io.*;
public class CitesteIntregi {
public static void main(String[] args) throws Exception{
BufferedReader t = new BufferedReader(new InputStreamReader(System.in));
int[] a = new int[10];
System.out.println("Introduceti 10 numere intregi!");
for(int i=0;i<a.length;i++){
String s = t.readLine();
int x = Integer.parseInt(s);
a[i] = x;
}
int sum = 0;
for(int i=0;i<a.length;i++){
sum = sum + a[i];
}
int y = 9;
System.out.println("SUMA ESTE:"+sum);
}
}