MapleStory Finger Point

๐Ÿ”ต C,C++,C#/๐Ÿ“šCore C_Programming

[C/Core C Programming] Chapter10.๊ตฌ์กฐ์ฒด

HYEJU01 2023. 3. 27. 19:31
#include <stdio.h>
void make_lower(char a[], char b[]);

typedef struct login
{
	char a[10];
	char b[10];

}LOGIN;



int main()
{
	 LOGIN arr;

	printf("ID?");
	gets(arr.a);
	printf("PASSWORD?");
	gets(arr.b);

	make_lower(arr.a, arr.b);

	return 0;
}

void make_lower(char a[], char b[]) {

	int a1, b1;
	a1 = strlen(a);
	b1 = strlen(b);

	for (int i = 0; i < a1; i++) {
		if (islower(a[i])==0)
		a[i] = tolower(a[i]);
	}
	printf("ID:   ");	
	puts(a);
	printf("PASSWORD:   ");
	for (int i = 0; i < b1; i++) {
		printf("*");
	}
}
#include <stdio.h>
void make_lower(char a[], char b[]);

typedef struct login
{
	char a[10];
	char b[10];
	char c[10];
	char d[10];

}LOGIN;



int main()
{
	LOGIN arr = { "","","hi","bye" };
	printf("ID?");
	gets(arr.a);
	printf("PASSWORD?");
	gets(arr.b);


	if (strcmp (arr.a, arr.c) == 0)
	{
		if (strcmp ( arr.b, arr.d) == 0 ) {
			printf("๋กœ๊ทธ์ธ ์„ฑ๊ณต");
		}
		else {
			printf("๋กœ๊ทธ์ธ ์‹คํŒจ");
		}
	}
	else {
		printf("๋กœ๊ทธ์ธ ์‹คํŒจ");
	}


	return 0;
}

#include <stdio.h>

void print_date(char a[], char b[], char c[]);

typedef struct date
{
	char a[10];
	char b[10];
	char c[10];

}DATE;



int main()
{
	DATE a = { "" };

	printf("Y?");
	gets(a.a);
	printf("M?");
	gets(a.b);
	printf("D?");
	gets(a.c);

	print_date(a.a, a.b, a.c);

	return 0;
}


void print_date(char a[], char b[], char c[]) {

	printf("%s/%s/%s", a, b, c);
}