Guest User

Untitled

a guest
Feb 18th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. static int[] divisors(int a)
  2. {
  3. int[] array = new int[a];
  4. int x = 0;
  5.  
  6.  
  7. for( int i =2; i<a; i++)
  8. {
  9.  
  10. if(a % i == 0)
  11. {
  12. array[x] = i;
  13. x++;
  14. }
  15.  
  16. }
  17.  
  18. if(array.Length == 0)
  19. {
  20.  
  21. return null;
  22. }
  23. else
  24. {
  25. return array;
  26. }
  27.  
  28. }
  29.  
  30. "Expected is <System.Int32[2]>, actual is <System.Int32[15]>
  31. Values differ at index [2]
  32. Extra: < 0, 0, 0... >"
Add Comment
Please, Sign In to add comment