C++刚刚学起 给我一个C++程序

来源:百度知道 编辑:UC知道 时间:2024/07/05 15:42:44
C++刚刚学起 给我一个C++程序
要有错误可以提示的`打出来一个字母就有很多提示的
还有相关的基础文章,或书籍都可以~~

//&代表皇后位置
#include "iostream"
#include "iomanip"
#define N 8
using namespace std;

char arr[N][N]={""};
int count=0;

int main()
{
void input(int m,int n);
void output();
int set_queen(int m);
void copy_arr(int num);

int m=0;
set_queen(m);
return 0;
}

void input(int m,int n)
{
for(int i=0;i<N;i++)
arr[i][n]='*';
for(int j=0;j<N;j++)
arr[m][j]='*';

int p,q;
p=m,q=n;
for(p++,q++;p<N && q<N;p++,q++)
arr[p][q]='*';
p=m,q=n;
for(p--,q--;p>=0 && q>=0;p--,q--)
arr[p][q]='*';

int a,b;
a=m,b=n;
for(a++,b--;a<N && b>=0;a++,b--)
arr[a][b]='*';
a=m,b=n;
for(a--,b++;a>=0 && b<N;a--,b++)
arr[a][b]='*';

arr[m][n]='&';
}