七巧板问题及 fatal error LNK1168: cannot open Debug/5.exe for writing报错

来源:互联网 发布:仓鼠用品淘宝 编辑:程序博客网 时间:2024/06/05 18:05
#include <stdio.h>
const int N = 7;            //定义七个区域

int main()
{
    char board[N] = {'A','B','C','D','E','F','G'};
    int arc [N][N] =  {{0,1,0,0,1,1,0},{1,0,1,1,0,0,0},{0,1,0,1,0,0,0},
    {0,1,1,0,1,0,1},{1,0,0,1,0,1,1},{1,0,0,0,1,0,0},{0,0,0,1,1,0,0}};
    int color[N] = {0};            //所有顶点均未涂色
    for(int i=0;i<N;)            //为i点涂色
    {
        color[i]++;
        if(color[i] > 4)            //i点试探所有颜色
        {
            color[i] = 0;            //取消顶点i的涂色
            i = i-1;
            continue;                //回溯到前一个顶点
        }
        for(int j=0;j<N;j++)
        {
            if((arc[i][j] == 1)&&(color[i] == color[j]))
                break;
        }
        if(j == N)
            i = i+1;
        }
        for(i=0;i<N;i++)
            printf("%c涂色%d\n",board[i],color[i]);
        return 0;

}



报错: fatal error LNK1168: cannot open Debug/5.exe for writing


说明你的程序正在运行或 前一次运行关闭不正常,窗口虽然消失了但是进程还在,用任务管理器结束它即可

阅读全文
1 0
原创粉丝点击