求大神指点,我该怎样把下面那个C语言程序编成子函数的形式来模拟两个色子的滚动.如果他们点子之和为7或者11,显示"you win "
#include <stdio.h>#include <stdlib.h>
#include <time.h>
int main(int argc, char *argv[])
{
int a,b,sum=0;
srand(time(NULL));
a=rand()%6+1;
b=rand()%6+1;
sum=a+b;
if(sum==7||sum==11)
printf(" you win\n");
else
printf(" you lose\n");
printf("%d %d %d \t",a,b,sum);
return 0;
}