반응형
- 코드 작성
using UnityEngine;
using UnityEngine.UI;
public class MultiplicationTable : MonoBehaviour
{
public Text tableText;
void Start()
{
int numRows = 10;
int numCols = 10;
string tableData = "";
for (int row = 1; row <= numRows; row++)
{
for (int col = 1; col <= numCols; col++)
{
int product = row * col;
tableData += product + "\t";
}
tableData += "\n";
}
tableText.text = tableData;
}
}
의뢰하기
반응형