Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

새싹교실/2016/리바이반/별찍기참고코드: Difference between revisions

From ZeroWiki
imported>장용운
No edit summary
imported>장용운
No edit summary
Line 45: Line 45:


= 결과 =
= 결과 =
[[새싹교실/2016/리바이반/0509/attachment:binggeul.png]]
[[:File:binggeul.png|binggeul.png]]
 
= 잡담 =
= 잡담 =
* 이 양식으로 구현하면 쉽습니다 - [[장용운]]
* 이 양식으로 구현하면 쉽습니다 - [[장용운]]



Revision as of 10:37, 9 May 2016

참고코드

#include <stdio.h>
#pragma warning(disable:4996)

int main(void) {
	const char star = '*';
	const char space = ' ';

	char c;
	int rows = 15;
	int cols = 14;
	for (int i = 0; i < rows; i++) {
		for (int j = 0; j < cols; j++) {
			c = space;

			if (/* 작성하세요 */) {
				if (/* 작성하세요 */)
					c = star;
			}
			else if (/* 작성하세요 */) {
				if (/* 작성하세요 */)
					c = star;
			}
			else if (/* 작성하세요 */) {
				if (/* 작성하세요 */)
					c = star;
			}
			else {
				if (/* 작성하세요 */)
					c = star;
			}



			printf("%c%c", c, c);
		}
		printf("\n");
	}


	return 0;
}

결과

binggeul.png

잡담

  • 이 양식으로 구현하면 쉽습니다 - 장용운