Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class petla2 : MonoBehaviour
- {
- int[] tab = new int[20];
- // Start is called before the first frame update
- void Start()
- {
- {
- for (int i = 0; i < 20; i++)
- {
- int a = Random.Range(0, 200);
- tab[i] = a;
- int b = a * a;
- if (b % 2 == 0)
- Debug.Log("kwadrat " + a + " jest parzysty i wynosi " + a * a);
- else
- {
- Debug.Log("kwadrat " + a + " jest nieparzysty i wynosi " + a * a);
- }
- }
- int[] tab2 = new int [20];
- for (int k=0; k<20; k++)
- {tab2[k] = b; }
- int max = tab2[0];
- for (int j = 0; j < 20; j++)
- {
- if (tab2[i] > max)
- {
- max = tab2[i];
- }
- }
- {
- Debug.Log("największy kwadrat to" + max);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement