#include <stdio.h>
int main(void)
{
int fac=0;
printf("숫자하나를 입력하세요 = ");
scanf("%d", &fac);
for(int sum = 0; fac>0; fac--)
{
sum*=fac;
}
printf("입력하신 수의 팩토리얼은 = %d입니다\n", sum);
return 0;
}
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) : 'scanf' 선언을 참조하십시오.
좆 해커가 니 프로그램을 좆병신 만들 수 있으니 조심하라는거다.
sum을 For문밖에서 변수선언해야함. 초기화값은 1로해라