fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. String str = "evenly";
  14. int a = str.length()-2;
  15. int b = str.length();
  16. //String res = (String)str.substring(str.length()-2,str.length());
  17. System.out.println(str.substring(0,-2));
  18. }
  19. public String deFront(String str) {
  20. if (str == "") { return ""; }
  21. if (str.length()==1) {
  22. if (str.charAt(0) == 'a') {
  23. return "a";
  24. } else {
  25. return "";
  26. }
  27. }
  28. if (str.length()==2) {
  29. if (str.charAt(0) == 'a' && str.charAt(1) == 'b') {
  30. return str;
  31. } else if (str.charAt(0) == 'a') {
  32. return str.substring(1);
  33. } else if (str.charAt(1) == 'b') {
  34. return str;
  35. }
  36. }
  37. if (str.charAt(0) == 'a' && str.charAt(1) == 'b') {
  38. return str;
  39. } else if (str.charAt(0) == 'a') {
  40. return str.substring(1);
  41. } else if (str.charAt(1) == 'b') {
  42. return str.charAt(0)+str.substring(2);
  43. } else {
  44. return str.substring(2);
  45. }
  46. }
  47. }
  48. }
Compilation error #stdin compilation error #stdout 0.07s 380160KB
stdin
Standard input is empty
compilation info
Main.java:48: error: class, interface, or enum expected
}
^
1 error
stdout
Standard output is empty