Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1.     void Start()
  2.     {
  3.         int max = 0;
  4.  
  5.         for (int i = 0; i < 20; i++)
  6.         {
  7.             int a = Random.Range(0, 200);
  8.  
  9.             tab[i] = a;
  10.             tab2[i] = a * a;
  11.  
  12.             if (tab2[i] > max)
  13.             {
  14.                 max = tab2[i];
  15.             }
  16.  
  17.             if (tab2[i] % 2 == 0)
  18.                 Debug.Log("kwadrat     " + a + "  jest parzysty i wynosi  " + tab2[i]);
  19.             else
  20.             {
  21.                 Debug.Log("kwadrat     " + a + "  jest nieparzysty i wynosi  " + tab2[i]);
  22.             }
  23.         }
  24.  
  25.         Debug.Log("największy kwadrat to" + max);
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement