Skip to content

Conversation

@anso33
Copy link
Contributor

@anso33 anso33 commented Mar 29, 2023

너비를 주고 가로세로를 구하라고 해서 가로세로를 미지수로 놓고 방정식을 이용했습니다.
노랑이 x ,y 일때 브라운이 x+2, y+2 를 가로세로로 가지게 되니까요.

변수명을 좀 거지같이 지었는데 brownSum은 갈색의 가로+세로 입니다..ㅋㅋ
image

@anso33 anso33 requested review from aLVINlEE9 and jis-kim March 29, 2023 23:40
@anso33
Copy link
Contributor Author

anso33 commented Mar 29, 2023

아ㅏ 제가 자꾸 브랜치 분기를 이상한데서 해서 다른 파일이 딸려오네요.. 킼킼 지송쓰!!! 담부터 더 주의하겠습니다!!

Copy link
Member

@jis-kim jis-kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

브랜치 다음부터 조심해라 ㅡㅡ 수고하셨어요~

// y = brownSum - x;
int brownSum = (brown - 4) / 2;

for (int i = 0; i < 2500; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전 0인 경우는 존재하지 않는다고 생각해서( 이유 : yellow 가 1 이상이면 그럴 일이 없습니다) 3부터 돌아줬읍니당

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

맞아요ㅋㅎㅋㅎ 사실 2500까지도 안갔어도 됐을 것 같습니다ㅎㅎㅎ 반성반성

for (int i = 0; i < 2500; i++) {
if (i * (brownSum - i) == yellow) {
x = i;
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 걍 i 를 밖에서 선언하고 break 해서 그대로 써도 됐을 듯 합니다!! 하지만 이정도는 취향일지도ㅎㅎ

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지수님 처럼! 맞아여 for문안에서 return 할 생각을 못함ㅋㅋㅋ

Copy link

@aLVINlEE9 aLVINlEE9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

멋지십니다!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants