// [[ 바꿀소스 ]] //////////////////////////////////
#include<stdio.h>
#include<windows.h>
int sum(int iGubun)
{
int iSum = 0;
for(int i=0; i<=15; i++)
{
iSum += i;
switch(iGubun)
{
case 1:
printf("=");
break;
case 2:
printf("*");
break;
case 3:
printf("#");
break;
}
Sleep(100);
}
return iSum;
}
void main()
{
int iResult = sum(2);
printf("\niResult => %d\n" , iResult);
}
// [[ 바꾼소스 ]] //////////////////////////////////
#include<stdio.h>
#include<windows.h>
typedef void(*DispFunc)();
void DispEqual()
{
printf("=");
}
void DispStar()
{
printf("*");
}
void DispSharp()
{
printf("#");
}
int sum(DispFunc Fp)
{
int iSum = 0;
for(int i=0 ; i<15 ; i++)
{
iSum += i;
Fp();
Sleep(100);
}
return iSum;
}
void main()
{
int iResult;
int iChoice;
scanf("%d",&iChoice);fflush(stdin);
switch(iChoice)
{
case 0:
iResult = sum(DispEqual);
break;
case 1:
iResult = sum(DispStar);
break;
case 2:
iResult = sum(DispSharp);
break;
}
printf("\niReslt -> %d\n" , iResult);
}