昭昭若昏vs斑竹15公告(二) 准陪审团排序名单
Select messages from
# through # 帮助
[/[Print]\]

海纳百川 -> 虚拟法庭

#1: 昭昭若昏vs斑竹15公告(二) 准陪审团排序名单 (4110 reads) 作者: 消极 文章时间: 2007-10-19 周五, 上午9:13
    —
作者:消极虚拟法庭 发贴, 来自 http://www.hjclub.org

过去48小时总共收到16网友报名,非常感谢各位的大力支持。

16位网友中,芦笛为本坛董事会成员,我向老狼核实,现取消其成为陪审团成员资格。所以有效报名网友为15人,下为名单,按报名先后顺序:
老石
xyzxyz
葡萄皮
xlwx
越南人
MariahSarey
apofainestai
汉城王
咱老百姓(真)
堂前燕
九戒
胖鹭鸶
常委
钟声
闲聊

现在从这个网站[http://www.state.nj.us/lottery/games/1-4_pick4.shtml]已知2007年10月18日Pick 4的号码为:2 8 1 3

通过计算机程序随机排序后产生的排序为:

1 闲聊
2 apofainestai
3 汉城王
4 葡萄皮
5 MariahSarey
6 胖鹭鸶
7 老石
8 九戒
9 钟声
10 xlwx
11 堂前燕
12 咱老百姓(真)
13 常委
14 越南人
15 xyzxyz



现双方在总版主开启权限后,可以开始排除程序,顺序为原告-〉被告-〉原告-〉被告,如果任何一方放弃,请在此贴下跟贴。如双方对原名单和排序名单有异议,也请跟贴。

请双方不要对你们双方纠纷发言,只对名单中的疑问发表意见。谢谢合作。

运行程序如下,程序中POOL_SIZE设为15,与上次不同,因为这次报名人数为15人。如对该程序有疑问,请看这贴:http://www.hjclub.com/showtopic.asp?ID=2659784,我偷懒不总结了,您主要看xyzxyz的贴,就明白了。
#include

#include



// We have only 20 candidates

#define POOL_SIZE 15



// seed is the result of NEW JERSEY LOTTERY PICK 4

// in the evening of 20 Oct. 2003. We hard-code it

// here. 

//#define seed 9968
#define seed 2813

#define NAMEFILE "c:\\names.txt"

#define OUTPUT "c:\\output.txt"

#define MAX_NAME_SIZE 40



int main ( )

{

FILE * fp , * fpo ;

int i ,j ,n ;// seed is a constant

wchar_t * names [ POOL_SIZE ] , * jury [ POOL_SIZE ] ;



//Allocate the memory

for ( i =0 ;i
names [ i ] = new wchar_t [ MAX_NAME_SIZE ] ;



//open the name file

fp = fopen ( NAMEFILE , "r" ) ;
fpo = fopen ( OUTPUT , "w" ) ;

if ( ! fp || ! fpo ) {

printf ( "Files open error!\n" ) ;

exit ( 0 ) ;

}


//Read the names into the array
//NAMEFILE is saved in a format of one name per line

i =0 ;

while ( ! feof ( fp ) &&i < POOL_SIZE )

fwscanf ( fp ,L"%S" ,names [ i ++ ] ) ;

fclose ( fp ) ;


//test

for ( i =0 ;i fwprintf ( fpo ,L"%S\n" ,names [ i ] );


fwprintf ( fpo ,L"\n" );



//Get the seed

//Don't need to read seed --- it's hard-coded

//printf("Please input the seed:");

//scanf("%i", &seed);

//Set the seed

srand ( seed ) ;

//Generate the order

//we will get one name in each iteration

//n is the number of names left in pool

//i is the order of jury candidates

for ( i =0 ,n =POOL_SIZE ;n >0 ;n -- ,i ++ ) {
j = rand ( ) %n ;

jury [ i ] =names [ j ] ;

//replace the chosen name by the last available name in the arry

//so that it will not be selected again.

names [ j ] =names [ n -1 ] ;

}



//print out the result

for ( i =0 ;i fwprintf ( fpo ,L"%i %S\n" ,i + 1 ,jury [ i ] ) ;
fclose ( fpo ) ;



return 0 ;

}



作者:消极虚拟法庭 发贴, 来自 http://www.hjclub.org



海纳百川 -> 虚拟法庭


output generated using printer-friendly topic mod. 所有的时间均为 北京时间

1页,共1

Powered by phpBB © 2001, 2005 phpBB Group