http://www.hackerschool.org/HS_Boards/zboard.php?id=QNA_programming&no=2052 [º¹»ç]
#include<stdio.h>
#include<string.h>
void concat3(char*,char*,char*,char*);
int main(void)
{
char str1[50];
char str2[50];
char str3[50];
char constr[150];
printf("3°³ÀÇ ¹®ÀÚ¿ ÀÔ·Â:");
scanf("%s,%s,%s",str1,str2,str3);
concat3(str1,str2,str3,constr);
puts(constr);
return 0;
}
void concat3(char *str1,char *str2,char *str3,char *constr)
{
if(strcmp(str1,str2)==1)
{
if(strcmp(str1,str3)==1)
{
strcpy(constr,str1);
if(strcmp(str2,str3)==1)
{
strcat(constr,str2);
strcat(constr,str3);
}
else
{
strcat(constr,str3);
strcat(constr,str2);
}
}
else
{
strcpy(constr,str3);
if(strcmp(str1,str2)==1){
strcat(constr,str1);
strcat(constr,str2);
}
else
{
strcat(constr,str2);
strcat(constr,str1);
}
}
}
else
{
if(strcmp(str2,str3)==1)
{
strcpy(constr,str2);
if(strcmp(str1,str3)==1)
{
strcat(constr,str1);
strcat(constr,str3);
}
else
{
strcat(constr,str3);
strcat(constr,str1);
}
}
else
{
strcpy(constr,str3);
if(strcmp(str1,str2)==1)
{
strcat(constr,str1);
strcat(constr,str2);
}
else
{
strcat(constr,str2);
strcat(constr,str1);
}
}
}
}
¾Æ·¡´Â ¿ö´× À̶ߴµ¥ ¿Ö±×·±Áö;;
±×¸®°í Á¤»óÀûÀ¸·Î µÅÁö¸¦ ¾Ê³×¿ä;;
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(14) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(306) : see declaration of 'scanf'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(27) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(30) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(31) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(35) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(36) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(41) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(43) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(44) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(48) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(49) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(57) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(60) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(61) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(65) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(66) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(71) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(74) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(75) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(79) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>c:\documents and settings\soul\my documents\visual studio 2008\projects\ex1\ex1\ex1.c(80) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(79) : see declaration of 'strcat'
1>Build log was saved at "file://c:\Documents and Settings\Soul\My Documents\Visual Studio 2008\Projects\ex1\ex1\Debug\BuildLog.htm"
1>ex1 - 0 error(s), 21 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== |
Hit : 5488 Date : 2009/06/08 10:06
|