彩票程序设计 彩票源程序

来源:百度知道 编辑:UC知道 时间:2024/06/04 00:33:05
要用C++编辑的 一定要有点难度 谢谢高手们

这个软件一般是没有免费的,你要去软件交易网看看
我这边有个简单的 你自己参考下
#include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node *next;
};
main()
{
int i,j,k,card[21],re,pe,count,m=0;
struct node head,*p,*q;
while(scanf("%d%d",&pe,&re)!=EOF)
{
for(i=0;i<20;i++)
scanf("%d",&card[i]);
head.next=NULL;
for(i=0;i<pe;i++)
{
p=(struct node *)malloc(sizeof(struct node));
p->data=pe-i;
p->next=head.next;
head.next=p;
}
p=head.next;
k=count=0;
while(count<(pe-re))
{
while(count<(pe-re)&&p->next!=NULL)
{
if(card[k]==1)
{
p=head.next;