Advertisement
Guest User

calc(java)

a guest
Jan 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. package com.company;
  2. import java.util.*;
  3.  
  4. public class Main {
  5.  
  6. public static void main(String[] args) {
  7. Double res = 0.0;
  8. Scanner in = new Scanner(System.in);
  9. String expression = in.nextLine();
  10.  
  11.  
  12. }
  13. }
  14.  
  15.  
  16. /*String avNums = "0123456789";
  17. String avLetters = " ()./*-+";
  18.  
  19. String[] splitEx = expression.split("");
  20. Boolean stop = false;
  21.  
  22. for (int i = 0; i < splitEx.length; i++)
  23. if (!avNums.contains(splitEx[i]) || !avLetters.contains(splitEx[i]))
  24. {
  25. stop = true;
  26. break;
  27. }
  28.  
  29. if (stop)
  30. {
  31. System.out.println("Input error");
  32. }
  33. else
  34. {
  35.  
  36. }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement