當前位置:星座運勢大全官網 - 周易占卜 - 求C語言高手,想得到不同的算法,源代碼,偽代碼,隨便。

求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失敗;

否則轉到重復:

}