-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1주차 Assignment - 조서윤 #7
base: main
Are you sure you want to change the base?
Conversation
// - 예: 필드 x가 1이고 dx가 10이면 x는 11로 변경되어야 함 | ||
|
||
// 객체 자신을 반환 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
힌트 드릴게요..!
Cylinder move(int dx, int dy) {
(빈칸)
return this;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 하면 중심이 이동되는 것이 아니라 이동값이 저장되지 않을까요..?!
x, y는 원의 중심이고 dx, dy는 이동값입니다!
그렇다면 (새로운 중심값) = (x + dx, y + dy)이 되겠죠?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
잘 수정하셨습니다!! 고생하셨어요 과제 통과입니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아직은 백준 문제가 많이 어려우실 거라 예상합니다! 그래도 최대한 한 줄 한 줄 주석을 달아가며 코드가 어떻게 동작하는 지 이해해 보면 좋을 것 같아요. Test1.java만 코멘트 부분 수정해서 다시 올려 주세요~
class Cylinder { | ||
|
||
// 원주율 3.14를 정적 상수 PI로 선언과 동시에 초기화 | ||
final double PI = 3.141592; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 정적 상수가 아닙니다! 필드를 정적 상수로 선언하려면 어떤 키워드가 추가되어야 할까요?🧐
int J = sc.nextInt(); // 종료 바구니 | ||
int K = sc.nextInt(); // 공 번호 | ||
|
||
for(int j = I - 1; j < J; j++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 0부터 시작하는 배열이 아니라 1부터 시작하는 문제일 경우 인덱스가 헷갈릴 때는 아예 배열의 크기를 +1로 잡아두고 시작하는 것도 방법입니다!
+1로 잡아두고 시작하면 복잡하게 배열 인덱스를 계산할 필요 없이 바구니 숫자와 배열 인덱스를 일치 시킬 수 있겠죠?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0부터 시작하면 복잡하게 계산되는 거군요...
감사합니다!!!!!!!!!!!!!!!!!!
|
||
public class Main { | ||
public static void main(String[] args) { | ||
Scanner sc = new Scanner(System.in); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음...문제 입출력과 상관없는 안내 문자열들이 포함 되어있네요! 뤼튼 gpt 사용해도 좋으니 만약 사용한다면 꼭 자세하게 이해했다는 의미에서 설명 주석을 달아주세요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 알겠습니당
Description
<!— 구현 및 작업 내용을 적어주세요 —>
Important content
<!— 주의 깊게 봐줬으면 하는 부분을 적어주세요 —>
Question
<!— 궁금한 점을 적어주세요 —>
Reference
<!— 참고한 레퍼런스가 있다면 공유해 주세요 —>