Network disconnected
Description
UserCode.cs의 5~7번째 줄에 정수형(int) 변수 age, 소수형 변수(float) height, 문자열(string) 변수 myName을 선언하고 값을 초기화하세요.
[실행]을 누르면 코드를 실행시켜서 결과를 확인할 수 있고, [제출]을 누르면 정답 여부를 체크하게 됩니다.
힌트: float형 변수에 값을 넣을 때는 숫자 뒤에 f를 적어 주어야 하고, 문자열에 값을 넣을 때는 큰따옴표 안에(" "
) 값을 넣어야 합니다.
Question type: Fill in the blank
- You need to fill in the blank with the appropriate code.
- You cannot modify the given code.
- An error message will appear in the result if you leave the blank empty.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using System;
public class UserCode : MonoBehaviour{
//이 아래줄에 age, height, myName을 선언하고 값을 초기화 하세요.
void Start(){
}
void Update(){
}
}
1
2
3
4
5
6
7
// 아래는 시스템 동작을 위한 코드입니다.수정하지 마세요
public class MainRunner{
public static void Main(){
MonoBehaviour mono = new MonoBehaviour();
mono.RunMono();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Unity의 MonoBehaviour와 유사하게 동작하기 위한 코드입니다.
// 수정하지 마세요
using System.Reflection;
public class MonoBehaviour{
public void RunMono(){
UserCode userCode = new UserCode();
MethodInfo mStartInfo = typeof(UserCode).GetMethod("Start", BindingFlags.NonPublic | BindingFlags.Instance);
if(mStartInfo != null){
mStartInfo.Invoke(userCode, null);
}
MethodInfo mUpdateInfo = typeof(UserCode).GetMethod("Update", BindingFlags.NonPublic | BindingFlags.Instance);
if(mUpdateInfo != null){
for(int i = 0; i < 10; i++){
mUpdateInfo.Invoke(userCode, null);
}
}
}
}
Result
Stop
Result of [Run Test] or [Submit] will be displayed here
내가 제출한 코드가 왜 틀렸는지 프로그래머스 AI에게 물어보세요.
제출 후 채점하기를 눌러 30점 이상인 경우 물어볼 수 있어요.
베타 기간 동안에는 한 문제당 1번만 물어볼 수 있어요.
베타 기간 동안에는 한 문제당 1번만 물어볼 수 있어요.