#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#include<process.h> //清屏
#include<fstream.h> //菜单文件
#include <math.h>
//数据结点
struct node1{
float data;
node1 *next;
};
//运算符号结点
struct node2{
char data;
node2 *next;
};
class t
{
private:
node1*head1; //存放数据
node2*head2; //存放运算符号
node1*head3; //已有测试
int count; //答题正确数
public:
//从文件中打开菜单
void menufile()
{
char ch;
ifstream infile("file.txt");
infile.unsetf(ios::skipws);
while(infile>>ch)cout<<ch;
}
//由输入建立两条链表,一条存放数据,一条存放运算符号
void build()
{
float x;
int s;
char str[80];
char y;
head1=new node1;
head1->data=0;
head1->next=NULL;
head2=new node2;
head2->data=0;
head2->next=NULL;
node1 *p1=head1;
node2 *q1=head2;
do
{
cin>>x;
s=cin.rdstate();
// cout<<s<<'\n';
cin.get(y);
// cout<<y<<'\n';
while(s||(y!='+'&&y!='-'&&y!='^'&&y!='*'&&y!='/'&&y!='\n'&&y!='('&&y!=')'))//输入非法
{
cin.clear();
cin.getline (str,80);
cout<<" 非法!请重新输入:";