Presentation Error#includeusing namespace std;struct ArcNode{int adjvex;ArcNode *next;};struct VertexNode{char vertex;ArcNode *firstedge;};const int MaxSize = 10;class ALGraph{public:ALGraph(char a[],int n,int e);ALGraph(){}char GetVex(int i);void Pu
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/06 00:22:41
Presentation Error#includeusing namespace std;struct ArcNode{int adjvex;ArcNode *next;};struct VertexNode{char vertex;ArcNode *firstedge;};const int MaxSize = 10;class ALGraph{public:ALGraph(char a[],int n,int e);ALGraph(){}char GetVex(int i);void Pu
Presentation Error
#include
using namespace std;
struct ArcNode
{
int adjvex;
ArcNode *next;
};
struct VertexNode
{
char vertex;
ArcNode *firstedge;
};
const int MaxSize = 10;
class ALGraph
{
public:
ALGraph(char a[],int n,int e);
ALGraph()
{
}
char GetVex(int i);
void PutVex(int i,char value);
void InsertVex(int i,char value);
void DeleteVex(int i);
void InsertArc(int i,int j);
void DeleteArc(int i,int j);
void DFSTraverse(int v);
void BFSTraverse(int v);
int visited[MaxSize];
int visited2[MaxSize];
private:
VertexNode adjlist[MaxSize];
int vertexNum;
int arcNum;
};
ALGraph::ALGraph(char a[],int n,int e)
{
int i;
int k;
int j;
ArcNode *s = NULL;
ArcNode *p = NULL;
vertexNum = n;
arcNum = e;
for(i = 0;i < vertexNum; i++)
{
adjlist[i].vertex = a[i];
adjlist[i].firstedge = NULL;
}
for(i = 0;i < vertexNum;i ++)
{
visited[i] = 0;
visited2[i] = 0;
}
for(k = 0;k < arcNum;k ++)
{
cin >> i >> j;
s = new ArcNode;
s->adjvex = j;
s->next = adjlist[i].firstedge;
adjlist[i].firstedge = s;
}
for(k = 0;k < vertexNum;k ++)
{
cout
Presentation Error#includeusing namespace std;struct ArcNode{int adjvex;ArcNode *next;};struct VertexNode{char vertex;ArcNode *firstedge;};const int MaxSize = 10;class ALGraph{public:ALGraph(char a[],int n,int e);ALGraph(){}char GetVex(int i);void Pu
哥们,不把题目链接贴出来,你叫别人怎么好帮你?
我只能靠猜了.
ACM对结果的格式要求很严格.Presentation Error就是说你答案对了,但是输出格式有问题.
我估计你每行都多输出了一个空格.随便举个例子:
for(k = 0;k < vertexNum;k ++)
{
cout