// fasdfs.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include
#define NUMBER 17
struct node{
int date;
node *link;
};
int main(int argc, char* argv[])
{
node *frist=new node;
node *current=new node;
frist->date=1;
frist->link =NULL;
current=frist;
int i=2;
while(i<=NUMBER)
{
node *p=new node;
p->date=i;
p->link=NULL;
current->link =p;
current=p;
if(i current->link =NULL;
else
{
current->link =frist;
current=frist;
}
i++;
}
current=frist->link ;
node *p;
p=current->link;
current->link =p->link ;
delete p;
int n=2;
while(n {
current=current->link->link;
p=current->link ;
current->link=p->link;
n++;
delete p;
}
cout<date< return 0;
}
--------------------next---------------------
阅读(1216) | 评论(0) | 转发(0) |