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 CitireTastatura { | ||
6 | public static void main(String[] args) throws Exception{ | ||
7 | BufferedReader t = new BufferedReader(new InputStreamReader(System.in)); | ||
8 | String x = t.readLine(); | ||
9 | String y = t.readLine(); | ||
10 | String o = t.readLine(); | ||
11 | int a = Integer.parseInt(x); | ||
12 | int b = Integer.parseInt(y); | ||
13 | if(o.equals("+")){ | ||
14 | int r = a+b; | ||
15 | System.out.println("Rezultat="+r); | ||
16 | }else if(o.equals("-")){ | ||
17 | int r = a-b; | ||
18 | System.out.println("Rezultat="+r); | ||
19 | }else | ||
20 | System.out.println("Operatie necunoscuta!"); | ||
21 | |||
22 | System.out.println("SFARSIT!"); | ||
23 | } | ||
24 | } |