求C语言高手,想得到不同的算法,源代码,伪代码,随便。
scanf();\ \获取输入整数
seed();\ \随机种子
for(temp = rand();温度%7!= 0;temp = rand());
for(temp 1 = rand();temp1%7!= 0;temp 1 = rand());
sum = temp+temp 1;
if(sum = = 7 | | sum = = 11)goto Victory;
else if(sum = = 2 | | sum = = 3 | | sum = = 12)goto失败;
其他
{
重复:
for(temp = rand();温度%7!= 0;temp = rand());
for(temp 1 = rand();temp1%7!= 0;temp 1 = rand());
if(sum = = temp+temp 1)goto Victory;
else if(temp+temp 1 = = 7)goto失败;
否则转到重复:
}