#include<stdio.h>
#include<stdlib.h>
#include<time.h>
double jieguo();
void main(){
int i,k;
int m,n;
int j;
printf("請輸入購買的號碼:\n");
scanf("%d",&i);
j=jieguo();
if(i==j)
printf("贏得的金額是500元\n");
if(i%100==j%100)
printf("贏得的金額是150元\n");
for(m=1;m<=5;m++){
i=i%100;
for(k=1,n=0;k<=5;k++){
j=j%100;
if(i==j)
n=n+1;
}
}
printf("%d\n",n);
if(n==5&&j%100==i%100)
printf("獎金是3000\n");
if((n==5&&j%100!=i%100)||(n==4&&j%100==i%100))
printf("獎金是200\n");
if((n==4&&j%100!=i%100)||(n==3&&j%100==i%100))
printf("獎金是10\n");
if((n==2&&j%100==i%100)||(n==1&&j%100==i%100)||(n==0&&j%100==i%100))
printf("獎金是5\n");
}
double jieguo(){
int a,b;
int i;
double sum;
srand(time(NULL));
for(i=1,sum=0;i<=6;i++){
a=rand()%37;
//printf("%d\n",a);
sum=sum*100;
sum +=a;
}
b=rand()%17;
sum=sum*100+b;
return sum;
}