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. int[] numbers = {1,2,4,-4,5,4,4};
  13. int [] thisTuple = new int[numbers.length];
  14. int count = 0;
  15. for(int j = 0; j < numbers.length; j++){
  16. if(numbers[j] > 0){
  17. thisTuple[count] = numbers[j];
  18. count++;
  19. }
  20. }
  21. int[] newTuple = new int[count];
  22. for(int i = 0; i < count; i++){
  23. newTuple[i] = thisTuple[i];
  24. }
  25. }
  26. }
Success #stdin #stdout 0.06s 381184KB
stdin
Standard input is empty
stdout
Standard output is empty