fork(118) 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. }
  14. function foo(int[] x, int a, int b, int i, int j) returns int
  15. int k = j
  16. int ct = 0
  17. while k > i-1
  18. if x[k] <= b and not (x[k] <= a)
  19. ct = ct + 1
  20. end
  21. k = k - 1
  22. end
  23. return ct
  24. end
  25.  
  26. int[] x = [8,10,20,15,20,15,20,10,17,12]
  27. int[] y = int[10000000000000000000]
  28. int m = 0
  29. while m < 10000000000000000000
  30. y[m] = m
  31. m = m +1
  32. end
  33.  
  34. print(foo(x,8,18,3,6))
  35. print(foo(x,10,20,0,9))
  36. print(foo(x,8,18,6,3))
  37. print(foo(x,20,10,0,9))
  38. print(foo(x,6,7,8,8))
  39. # Please be careful with typos for the output of the following lines!
  40. print(foo(y,
  41. 111112222233333, # five 1's, then five 2's, then five 3's
  42. 999998888877777, # five 9's, then five 8's, then five 7's
  43. 222223333344444, # five 2's, then five 3's, then five 4's
  44. 905003340009900023))
  45. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:14: error: ';' expected
	function foo(int[] x, int a, int b, int i, int j) returns int
	                                                 ^
Main.java:14: error: <identifier> expected
	function foo(int[] x, int a, int b, int i, int j) returns int
	                                                             ^
Main.java:15: error: <identifier> expected
   int k = j
        ^
Main.java:15: error: ';' expected
   int k = j
            ^
Main.java:16: error: ';' expected
   int ct = 0
             ^
Main.java:17: error: <identifier> expected
   while k > i-1
          ^
Main.java:17: error: <identifier> expected
   while k > i-1
              ^
Main.java:17: error: illegal start of type
   while k > i-1
               ^
Main.java:17: error: <identifier> expected
   while k > i-1
                ^
Main.java:18: error: ';' expected
       if x[k] <= b and not (x[k] <= a)
         ^
Main.java:18: error: illegal start of type
       if x[k] <= b and not (x[k] <= a)
           ^
Main.java:18: error: ';' expected
       if x[k] <= b and not (x[k] <= a)
             ^
Main.java:18: error: ';' expected
       if x[k] <= b and not (x[k] <= a)
                       ^
Main.java:18: error: invalid method declaration; return type required
       if x[k] <= b and not (x[k] <= a)
                        ^
Main.java:18: error: ']' expected
       if x[k] <= b and not (x[k] <= a)
                               ^
Main.java:18: error: ')' expected
       if x[k] <= b and not (x[k] <= a)
                                ^
Main.java:18: error: illegal start of type
       if x[k] <= b and not (x[k] <= a)
                                  ^
Main.java:18: error: ';' expected
       if x[k] <= b and not (x[k] <= a)
                                      ^
Main.java:19: error: <identifier> expected
           ct = ct + 1
             ^
Main.java:19: error: ';' expected
           ct = ct + 1
                      ^
Main.java:21: error: ';' expected
       k = k - 1
                ^
Main.java:22: error: <identifier> expected
   end
      ^
Main.java:24: error: ';' expected
end
   ^
Main.java:26: error: illegal start of expression
int[] x = [8,10,20,15,20,15,20,10,17,12]
          ^
Main.java:26: error: illegal start of type
int[] x = [8,10,20,15,20,15,20,10,17,12]
           ^
Main.java:26: error: <identifier> expected
int[] x = [8,10,20,15,20,15,20,10,17,12]
            ^
Main.java:26: error: ';' expected
int[] x = [8,10,20,15,20,15,20,10,17,12]
             ^
Main.java:26: error: illegal start of type
int[] x = [8,10,20,15,20,15,20,10,17,12]
               ^
Main.java:26: error: <identifier> expected
int[] x = [8,10,20,15,20,15,20,10,17,12]
                ^
Main.java:26: error: <identifier> expected
int[] x = [8,10,20,15,20,15,20,10,17,12]
                   ^
Main.java:26: error: illegal start of type
int[] x = [8,10,20,15,20,15,20,10,17,12]
                     ^
Main.java:26: error: <identifier> expected
int[] x = [8,10,20,15,20,15,20,10,17,12]
                      ^
Main.java:26: error: <identifier> expected
int[] x = [8,10,20,15,20,15,20,10,17,12]
                         ^
Main.java:26: error: illegal start of type
int[] x = [8,10,20,15,20,15,20,10,17,12]
                           ^
Main.java:26: error: <identifier> expected
int[] x = [8,10,20,15,20,15,20,10,17,12]
                            ^
Main.java:26: error: <identifier> expected
int[] x = [8,10,20,15,20,15,20,10,17,12]
                               ^
Main.java:26: error: illegal start of type
int[] x = [8,10,20,15,20,15,20,10,17,12]
                                 ^
Main.java:26: error: <identifier> expected
int[] x = [8,10,20,15,20,15,20,10,17,12]
                                  ^
Main.java:26: error: <identifier> expected
int[] x = [8,10,20,15,20,15,20,10,17,12]
                                     ^
Main.java:26: error: illegal start of type
int[] x = [8,10,20,15,20,15,20,10,17,12]
                                       ^
Main.java:26: error: <identifier> expected
int[] x = [8,10,20,15,20,15,20,10,17,12]
                                        ^
Main.java:27: error: ';' expected
int[] y = int[10000000000000000000]
     ^
Main.java:27: error: <identifier> expected
int[] y = int[10000000000000000000]
       ^
Main.java:27: error: ']' expected
int[] y = int[10000000000000000000]
              ^
Main.java:27: error: ';' expected
int[] y = int[10000000000000000000]
                                  ^
Main.java:28: error: ';' expected
int m = 0
         ^
Main.java:29: error: illegal start of type
while m <  10000000000000000000
           ^
Main.java:30: error: ']' expected
 y[m] = m
   ^
Main.java:30: error: illegal start of type
 y[m] = m
    ^
Main.java:30: error: <identifier> expected
 y[m] = m
     ^
Main.java:30: error: ';' expected
 y[m] = m
       ^
Main.java:31: error: <identifier> expected
 m = m +1
  ^
Main.java:31: error: ';' expected
 m = m +1
         ^
Main.java:34: error: <identifier> expected
print(foo(x,8,18,3,6))
         ^
Main.java:34: error: ';' expected
print(foo(x,8,18,3,6))
          ^
Main.java:34: error: illegal start of type
print(foo(x,8,18,3,6))
           ^
Main.java:34: error: <identifier> expected
print(foo(x,8,18,3,6))
            ^
Main.java:34: error: <identifier> expected
print(foo(x,8,18,3,6))
              ^
Main.java:34: error: illegal start of type
print(foo(x,8,18,3,6))
                ^
Main.java:34: error: <identifier> expected
print(foo(x,8,18,3,6))
                 ^
Main.java:34: error: <identifier> expected
print(foo(x,8,18,3,6))
                   ^
Main.java:34: error: illegal start of type
print(foo(x,8,18,3,6))
                    ^
Main.java:34: error: <identifier> expected
print(foo(x,8,18,3,6))
                     ^
Main.java:34: error: ';' expected
print(foo(x,8,18,3,6))
                      ^
Main.java:35: error: illegal start of type
print(foo(x,10,20,0,9))
     ^
Main.java:35: error: <identifier> expected
print(foo(x,10,20,0,9))
           ^
Main.java:35: error: illegal start of type
print(foo(x,10,20,0,9))
            ^
Main.java:35: error: illegal start of type
print(foo(x,10,20,0,9))
               ^
Main.java:35: error: illegal start of type
print(foo(x,10,20,0,9))
                  ^
Main.java:35: error: illegal start of type
print(foo(x,10,20,0,9))
                    ^
Main.java:35: error: ';' expected
print(foo(x,10,20,0,9))
                      ^
Main.java:39: error: illegal character: '#'
# Please be careful with typos for the output of the following lines!
^
Main.java:41: error: illegal character: '#'
         111112222233333, # five 1's, then five 2's, then five 3's
                          ^
Main.java:41: error: unclosed character literal
         111112222233333, # five 1's, then five 2's, then five 3's
                                  ^
Main.java:41: error: unclosed character literal
         111112222233333, # five 1's, then five 2's, then five 3's
                                                 ^
Main.java:41: error: unclosed character literal
         111112222233333, # five 1's, then five 2's, then five 3's
                                                                ^
Main.java:42: error: illegal character: '#'
         999998888877777, # five 9's, then five 8's, then five 7's
                          ^
Main.java:42: error: unclosed character literal
         999998888877777, # five 9's, then five 8's, then five 7's
                                  ^
Main.java:42: error: unclosed character literal
         999998888877777, # five 9's, then five 8's, then five 7's
                                                 ^
Main.java:42: error: unclosed character literal
         999998888877777, # five 9's, then five 8's, then five 7's
                                                                ^
Main.java:43: error: illegal character: '#'
         222223333344444, # five 2's, then five 3's, then five 4's
                          ^
Main.java:43: error: unclosed character literal
         222223333344444, # five 2's, then five 3's, then five 4's
                                  ^
Main.java:43: error: unclosed character literal
         222223333344444, # five 2's, then five 3's, then five 4's
                                                 ^
Main.java:43: error: unclosed character literal
         222223333344444, # five 2's, then five 3's, then five 4's
                                                                ^
84 errors
stdout
Standard output is empty