实用文档
本科实验报告
课程名称: 编译原理
实验(m[i] < 48 || m[i] > 57) {
i++;
} else { do {
d = m[i] - 48;
w = w * 10 + d;
j++;
i++;
} while (m[i] >= 48 && m[i] <= 57); // ("chesi"+m[i]); if (m[i] != '.') {
if (m[i] != 'E') {
(" 整型数为: " + w);
j = 0;
w = 0;
} else { i++;
实用文档
if (m[i] == '-') {
e = -1;
i++;
if (m[i] >= 48 && m[i] <= 57) {
do {
d = m[i] - 48;
p = p * 10 + d;
i++;
} while (m[i] >= 48 && m[i] <= 57); if (j > 1)
w2 = w / ((, j - 1));
(" 实型数为: " + w2 + "*10" + " "
+ (e * (p - j + 1)));
j = 0;
w2 = 0;
w = 0;
p = 0;
} else
(" 您输入有误! ");
} else if (m[i] == '+') { i++;
if (m[i] >= 48 && m[i] <= 57) { do {
d = m[i] - 48;
p = p * 10 + d;
i++;
} while (m[i] >= 48 && m[i] <= 57); if (j > 1)
w2 = w / ((, j - 1));
(" 实型数为: " + w2 + "*10" + " "
+ (e * (p + j - 1)));
j = 0;
w2 = 0;
w = 0;
p = 0;
} else
(" 您输入有误! ");
} else {
if (m[i] >= 48 && m[i] <= 57) {
do {
d = m[i] - 48;
p = p * 10 + d;
实用文档
i++;
} while (m[i] >= 48 && m[i] <= 57); if (j > 1)
w2 = w / ((, j - 1));
("实型数为: " + w2 + "*10" + " "
+ (e * (p + j - 1)));
j = 0;
w2 = 0;
w = 0;
p = 0;
} else
(" 您输入有误! ");
}
}
}
else {
i++;
if (m[i] >= 48 && m[i] <= 57) {
do {
d = m[i] - 48;
w1 = w1 * 10 + d;
j = j + 1; i++;
} while (m[i] >= 48 && m[i] <= 57); } else
(" 您输入有误! ");
if (m[i] != 'E') {
(" 小数为: " + w + '.' + w1);
w = 0;
w1 = 0;
j = 0;
} else if (m[i] == 'E') {
i++;
if (m[i] == '-') {
e = -1;
i++;
if (m[i] >= 48 && m[i] <= 57) {
do {
d = m[i] - 48;
p = p * 1
太原理工大学编译原理实验 来自淘豆网m.daumloan.com转载请标明出处.