using UnityEngine;
using System.Collections;
public class Zoro : MonoBehaviour {
// Use this for initialization
void Start () {
string text;
for(int i = 4; i >= 0; i--){
text = " ";
for(int j = 0; j < 5; j++){
if(i ==0){
text = text + "*";
}
else if( i>=1 && i < 4){
if(i > j)
text = text + " ";
if(i == j)
text = text + "*";
if(i < j)
text = text + " ";
}
else if(i==4){
text = text + "*";
}
}
print (text);
}
}
'Computer Language > 유니티' 카테고리의 다른 글
함수(매개변수 2개, 매개변수 3개, 형꺼 한개) (0) | 2014.04.07 |
---|---|
등차수열 (0) | 2014.04.07 |
나라 출력 (0) | 2014.04.07 |
정수값을 입력받고 문자로 치환해서 성적 구하기.(배열 if switch) (0) | 2014.04.07 |
배열과 if문 활용하여 성적 출력하기 (0) | 2014.04.07 |