http://www.hackerschool.org/HS_Boards/zboard.php?id=Free_Lectures&no=8153 [º¹»ç]
#include <stdio.h>
#include <string.h>
int main(void)
{
char passwd[16] = "abcd"; //passwd°¡ abcd·Î ÁöÁ¤µÇ¾îÀÖ½À´Ï´Ù
char input[16] = {'0'}; // Æ佺¿öµå ÀÔ·Â¹Þ´Â Ä À»¸¸µé±âÀ§ÇÑ ÇÔ¼öÀÔ´Ï´Ù
printf("¾ÏÈ£ :"); //¹®ÀÚÃâ·Â
scanf("%s", input); //À§¿¡ inputÇÔ¼öÀÇ ÀԷ¹޴ÂÇÔ¼ö
if( strncmp(passwd, input , 4) == 0) //passwd¿Í inputÀÌ ¼º¸³ÇÒ°æ¿ì
{
printf("·Î±×ÀÎ ¼º°ø \n"); //ÀÌ·±½ÄÀ¸·Î °á°ú°¡ ³ª¿À°í
}
else //±× ÀÌ¿ÜÀÇ °æ¿ì
printf("·Î±×ÀÎ ½ÇÆÐ \n"); //ÀÌ ¹®ÀÚ°¡ Ãâ·ÂµË´Ï´Ù
return 0;
} //ÇÁ·Î±×·¥ ¸¶Ä§
|
Hit : 7674 Date : 2015/09/24 01:09
|