ga_nn.cpp

来自「遗传算法的C语言计算」· C++ 代码 · 共 36 行

CPP
36
字号
// GA_NN.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
//#include "graphics.h"
//#include "F:\program_soft\Turbo\Turb\graphics.h"
//#include "bios.h"
#include "conio.h"
#include "process.h"
#include "io.h"
#include "dos.h"
#include "iostream.h"

int main(int argc, char* argv[])
{
	//setcolor(200);
	int temp;
	int mask=1;
	while(1)
	{
	cout<<"Please input your number:";
	cin>>temp;
	
	for(int i=0;i<8*sizeof(unsigned);i++)
	{
		if(temp&mask)
			cout<<"1";
		else
			cout<<"0";
		temp=temp>>1;
	}
	}
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?