c语言 打印黑色图案T 编好了 但是总有一个错误

来源:百度知道 编辑:UC知道 时间:2024/09/22 12:41:40
#include<stdio.h>
#include<conio.h>

float computethreshold(int image[8][8]);
void convertToBinaryImage(int image [8][8],float threshold);

main()
{
int image[8][8]={6,6,6,6,6,6,6,6,
6,2,2,2,2,2,2,6,
6,3,1,0,1,1,2,7,
6,6,5,0,1,5,6,6,
6,6,5,3,3,5,6,7,
7,6,5,3,2,6,6,7,
7,6,6,2,2,5,6,7,
7,7,7,7,7,7,7,7};
int i,j;
float t;
t=computethreshold(image [8][8]);
convertToBinaryImage(image [8][8],t);
for(i=0;i<8;i++)
{printf("\n");
for(j=0;j<8;j++)
{
if(image[i][j]==1)
printf("\219");
else
printf(" ");
}
}
return 0;
}

float computethreshold(int image[8][8])
{int i,j,max,min;
float threshold;
max=image[0][0];
min=image[0][0];
for(i=0;i<8;i++)
for(j=0;j<8;j++

#include<stdio.h>
#include<conio.h>

float computethreshold(int image[8][8]);
void convertToBinaryImage(int image [8][8],float threshold);

main()
{
int image[8][8]={6,6,6,6,6,6,6,6,
6,2,2,2,2,2,2,6,
6,3,1,0,1,1,2,7,
6,6,5,0,1,5,6,6,
6,6,5,3,3,5,6,7,
7,6,5,3,2,6,6,7,
7,6,6,2,2,5,6,7,
7,7,7,7,7,7,7,7};
int i,j;
float t;
t=computethreshold(image); //将此行改为这样
convertToBinaryImage(image,t); //将此行改为这样
for(i=0;i<8;i++)
{printf("\n");
for(j=0;j<8;j++)
{
if(image[i][j]==1)
printf("\219");
else
printf(" ");
}
}
return 0;
}

float computethreshold(int image[8][8])
{int i,j,max,min;
float threshold;
max=image[0][0];
min=image[0][0];
for(i=0;i<8;i++)
for(j=0;j<8;j++)
{if(image[i][j]>max)
max=im