::main' must return 'int' 这个咋解决,求出大神
#include "stdio.h"#include "stdlib.h"
typedef struct node{
char ch;
node *next;
}Linkstack;
Linkstack *Setstack(){
Linkstack *S;
S=(Linkstack*)malloc(sizeof(Linkstack));
S->next=NULL;
return S;
}
Linkstack *Pushstack(Linkstack *S,char c){
Linkstack *p;
p=(Linkstack*)malloc(sizeof(Linkstack));
p->ch=c;
p->next=S->next;
S->next=p;
return S;
}
Linkstack *Popstack(Linkstack *S){
Linkstack *p;
p=S->next;
S->next=p->next;
free(p);
return S;
}
char Gettop(Linkstack *S){
if(S->next!=NULL)
return S->next->ch;
else
return ' ';
}
int Judgepair(){
Linkstack *p;
char c;
int sign=1;
p=Setstack();
printf("请输入算术表达式,并以'#'结束\n");
c=getchar();
while(c!='#'){
switch(c){
case'(':
p=Pushstack(p,c);
break;
case')':
if(Gettop(p)=='(')
p=Popstack(p);
else
sign=0;
break;
}
if(sign==0)
break;
else
c=getchar();
}
if(p->next!=NULL)
sign=0;
return sign;
}
void Judgeout(int a){
if(a==1)
printf("算术表达式小括号配对正确!\n");
if(a==0)
printf("算术表达式小括号配对错误!\n");
}
void main(){
Judgeout(Judgepair());
}
76 11 C:\Users\VULCAN\Desktop\1.cpp [Error] '::main' must return 'int'