public class Arvutamine{ public static void main(String[] sm){ if(sm.length>1){ int arv1=Integer.parseInt(sm[0]); int arv2=Integer.parseInt(sm[1]); String tehe="x"; if(sm.length>=3){ tehe=sm[2]; } System.out.println(tehe); if(tehe.equals("+")){ //lisage lahutamistehe System.out.println(arv1+arv2); } else if(tehe.equals("-")){ System.out.println(arv1-arv2); } else { System.out.println(arv1 * arv2); } } } }