c语言中spread函数 c sprintf函数

C语言中的图形函数有哪些一) 像素函数
putpiel() 画像素点函数
getpixel()返回像素色函数
(二) 直线和线型函数
line() 画线函数
lineto() 画线函数
linerel() 相对画线函数
setlinestyle() 设置线型函数
getlinesettings() 获取线型设置函数
setwritemode() 设置画线模式函数
(三)、多边形函数
rectangle() 画矩形函数
bar() 画条函数
bar3d() 画条块函数
drawpoly() 画多边形函数
(四)、 圆、弧和曲线函数
getaspectratio()获取纵横比函数
circle()画圆函数
arc() 画圆弧函数
ellipse()画椭圆弧函数
fillellipse() 画椭圆区函数
pieslice() 画扇区函数
sector() 画椭圆扇区函数
getarccoords()获取圆弧坐标函数
(五)、 填充函数
setfillstyle() 设置填充图样和颜色函数
setfillpattern() 设置用户图样函数
floodfill() 填充闭域函数
fillpoly() 填充多边形函数
getfillsettings() 获取填充设置函数
getfillpattern() 获取用户图样设置函数
(六)、图像函数
imagesize() 图像存储大小函数
getimage() 保存图像函数
putimage() 输出图像函数
图 (c语言)我来做,等等
/*编写无向图的邻接矩阵类AdjMWGraph,实现无向图的广度遍历和深度遍历 。
其中,图中顶点数据类型为字符 。Input第一行图中顶点的个数n(4=n=26)
第二行是图中边的条数m(3=m=351) 第三行是顶点信息(全为大写字母)
后面的输入数据是依附于一条边的两个顶点,有多少条边 , 就输入多少组信息 。
注意:根结点都为A;并且所给字符连续,也就是说A B C D …… 。
Output广度优先搜索序列 。深度优先搜索序列 。
Sample Input
7
6
A B C D E F G
A B
A C
B D
B E
C F
C G
Sample Output
A B C D E F G
A B D E C F G
*/
#include stdio.h#include stdlib.h
unsigned char arrMap[26][26] = {0};
int nV = 0;
void deep_prior_scan(int j);
void spread_prior_scan(int j);
void GetResult()
{
int nL = 0;//存储边数
int i;
char arrV[26] = {0};
char temp, pairV[2];
//输入过程
printf("\n请输入顶点数:");
scanf("%d", nV);
printf("\n请输入边数:");
scanf("%d", nL);
printf("\n请依次输入顶点:\n");
for (i = 0, temp = 'A'; inV; )
{
temp = getchar();
if (temp = 'A'temp = 'Z')
{
arrV[i++] = temp;
}
}
printf("\n请依次输入边:\n");
for (i = 0; inL*2; )
{
temp = getchar();
if (temp = 'A'temp = 'Z')
{
pairV[i%2] = temp;
if (i%2 == 1)
{
arrMap[pairV[0] - 'A'][pairV[1] - 'A'] = 1;
}
++i;
}
}
//printf("\n广度优先遍历:\n");
//spread_prior_scan(0);
//printf("\n");
printf("\n深度优先遍历:\n");
deep_prior_scan(0);
printf("\n");
}
int main()
{
GetResult();
system("pause");
return 0;
}
void deep_prior_scan(int j)
{
int i;
printf("%c ", j + 'A');
for (i = 0; inV; i++)
{
if (arrMap[j][i] != 0)
{
arrMap[j][i] = 0;
deep_prior_scan(i);
}
}
}
void spread_prior_scan(int j)
{
int i;
if (j == 0)
{
printf("\nA ");
}
if (j = 26)
{
printf("\nj=%d\n", j);
}
for (i = 0; inV; i++)
{
if (arrMap[j][i] != 0)
{
printf("%c ", i + 'A');
}
}
for (i = 0; inV; i++)
{
if (arrMap[j][i] != 0)

推荐阅读