?? classification.cpp
字號:
// classification.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <conio.h>
#include "Gene.h"
#define maxnode 34
char stringinitial[maxnode+1];
int strlength;
char headtype[]="+-*/ILE~SCQa?"; //what kinds of characters can be read to the head.
char tailtype[]="a?";
double Dc[7]={1.0,2.0,3.0,5.0,7.0};
void initialchar();
void main(int argc, char* argv[])
{
int i,count;
for(count=0;count<20;count++)
{
initialchar();
cout<<"initial:";
cout<<stringinitial<<endl;
i=13;
Gene gene(stringinitial,i);
gene.Insert();
gene.Postorder(gene.headpoint);
double tenvary[2]={4.0,0.0};
gene.Result(Dc,tenvary);
cout<<"result="<<gene.Displayresult()<<endl;
if(count%50==0)getch();
}
}
void initialchar()
{
int i,point;
srand((unsigned)time(NULL));
for(i=0;i<13;i++){
if(i<6)
{
point=rand()%(13);
stringinitial[i] = headtype[point];
} /*get the genes' head from the head set.*/
else
{
point=rand()%(2);
stringinitial[i] = tailtype[point];
} /*get the genes' tail from the tail set.*/
}
stringinitial[i]='\0';
//for(int j=0;j<13;i++)cout<<string[j]<<endl;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -