๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
โœ’๏ธ C Programming/๋ˆ„๊ตฌ๋‚˜ ์‰ฝ๊ฒŒ ์ฆ๊ธฐ๋Š” C ์–ธ์–ด ์ฝ˜์„œํŠธ_๊ฐœ์ • 3ํŒ

[๋ˆ„๊ตฌ๋‚˜ ์‰ฝ๊ฒŒ ์ฆ๊ธฐ๋Š” C ์–ธ์–ด ์ฝ˜์„œํŠธ - ๊ฐœ์ • 3ํŒ] 14์žฅ Mini Project ๋ฌธ์ œ ํ’€์ด

by A Lim Han 2023. 2. 3.

# 14์žฅ Mini Project ๋ฌธ์ œ ํ’€์ด

 

 

544p_Mini Project)

#include <stdio.h>
#define language 3

int main()
{
	#if language == 1  //ํ•œ๊ตญ์–ด๋กœ ์ถœ๋ ฅ
	printf("=================== 2์›” ====================\n");
	printf("์ผ     ์›”     ํ™”     ์ˆ˜     ๋ชฉ     ๊ธˆ     ํ† \n");

	for (int i = 1; i < 29; i++)
	{
		if (i % 7 == 4)
		{
			printf("%d     ", i);
			printf("\n");
		}
		else
		{
			if (i < 10)
			{
				if (i == 1)
				{
					printf("                     %d      ", i);
				}
				else
				{
					printf("%d      ", i);
				}
			}
			else
			{
				printf("%d     ", i);
			}
		}
	}

	#else              //์˜์–ด๋กœ ์ถœ๋ ฅ
	printf("==================== Feb ====================\n");
	printf("SUN    MON    TUE    WED    THU    FRI    SAT\n");

	for (int i = 1; i < 29; i++)
	{
		if (i % 7 == 4)
		{
			printf("%d     ", i);
			printf("\n");
		}
		else
		{
			if (i < 10)
			{
				if (i == 1)
				{
					printf("                     %d      ", i);
				}
				else
				{
					printf("%d      ", i);
				}
			}
			else
			{
				printf("%d     ", i);
			}
}
	}
	#endif

	return 0;
}

์ขŒ์ธก์€ ํ•œ๊ตญ์–ด, ์šฐ์ธก์€ ์˜์–ด ๋ฒ„์ „