Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. static int[] Assigning ()
  2. {
  3. // Initialization.
  4. int f = 0, s = 0;
  5. int[] resArr = new int[101];
  6.  
  7. // Logic.
  8. for(int i = 0; i < resArr.Length; i++)
  9. {
  10. if (f == 0)
  11. {
  12. f = i + 1;
  13. resArr[i] = f;
  14. s = 0;
  15. }
  16. else if(s == 0)
  17. {
  18. s = i + 1;
  19. resArr[i] = s;
  20. f = 0;
  21. }
  22. }
  23.  
  24. // Output.
  25. return resArr;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement