SyntaxError: syntax error [在此错误处中断] <!DOCTYPE HTML。。。(转)

转自: http://hi.baidu.com/tlogin/item/70b285c92d89f47789ad9ecc

SyntaxError: syntax error [在此错误处中断] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//E

syntax error [Break on this error] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML…3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

SyntaxError: syntax error [在此错误处中断] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//E

 

原因在于所使用的javascript引用出错,未填写src。

1
<script src= ""  language= "JavaScript" ></script>

填上正常的src地址,正常了。

1
<script src= "http://s96.cnzz.com/stat.php?id=123456789&web_id=123456789&show=none" language= "JavaScript" ></script>

还可查看:

http://blog.ryanrampersad.com/2008/09/syntax-error-break-on-this-error-doctype-html-public-w3cdtd-xhtml3orgtr-xhtml1-dtd-xhtml1-strictdtd/

转载于:https://www.cnblogs.com/summer520/p/3360845.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的算术表达式求值的代码,使用了逆波兰表达式换和栈的数据结构,可以支持负数和小数的计算: ``` #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define MAX_STACK_SIZE 1024 typedef struct Stack { double data[MAX_STACK_SIZE]; int top; } Stack; void stack_init(Stack *s) { s->top = -1; } int stack_empty(Stack *s) { return s->top == -1; } void stack_push(Stack *s, double x) { if (s->top >= MAX_STACK_SIZE - 1) { printf("Stack overflow!\n"); exit(1); } s->data[++s->top] = x; } double stack_pop(Stack *s) { if (stack_empty(s)) { printf("Stack underflow!\n"); exit(1); } return s->data[s->top--]; } double stack_top(Stack *s) { if (stack_empty(s)) { printf("Stack underflow!\n"); exit(1); } return s->data[s->top]; } int is_operator(char c) { return c == '+' || c == '-' || c == '*' || c == '/'; } int priority(char c) { if (c == '+' || c == '-') return 1; if (c == '*' || c == '/') return 2; return 0; } void infix_to_postfix(char *infix, char *postfix) { int i, j; Stack s; stack_init(&s); for (i = j = 0; infix[i]; i++) { if (infix[i] == '(') { stack_push(&s, infix[i]); } else if (infix[i] == ')') { while (!stack_empty(&s) && stack_top(&s) != '(') { postfix[j++] = stack_pop(&s); } if (stack_empty(&s) || stack_top(&s) != '(') { printf("Invalid expression!\n"); exit(1); } stack_pop(&s); } else if (is_operator(infix[i])) { while (!stack_empty(&s) && priority(stack_top(&s)) >= priority(infix[i])) { postfix[j++] = stack_pop(&s); } stack_push(&s, infix[i]); } else if (infix[i] >= '0' && infix[i] <= '9') { postfix[j++] = infix[i]; } else if (infix[i] == '.') { postfix[j++] = infix[i]; } else if (infix[i] == '-') { if (i == 0 || is_operator(infix[i-1]) || infix[i-1] == '(') { postfix[j++] = '0'; postfix[j++] = '-'; } else { postfix[j++] = infix[i]; } } else { printf("Invalid character: %c\n", infix[i]); exit(1); } } while (!stack_empty(&s)) { if (stack_top(&s) == '(') { printf("Invalid expression!\n"); exit(1); } postfix[j++] = stack_pop(&s); } postfix[j] = '\0'; } double evaluate_postfix(char *postfix) { Stack s; stack_init(&s); int i; for (i = 0; postfix[i]; i++) { if (postfix[i] >= '0' && postfix[i] <= '9') { double x = 0.0; int k = 0; while (postfix[i] >= '0' && postfix[i] <= '9') { x = x * 10.0 + postfix[i++] - '0'; } if (postfix[i] == '.') { i++; while (postfix[i] >= '0' && postfix[i] <= '9') { x += (postfix[i++] - '0') * pow(10.0, -k++); } } stack_push(&s, x); i--; } else if (is_operator(postfix[i])) { double b = stack_pop(&s); double a = stack_pop(&s); switch (postfix[i]) { case '+': stack_push(&s, a + b); break; case '-': stack_push(&s, a - b); break; case '*': stack_push(&s, a * b); break; case '/': stack_push(&s, a / b); break; } } else { printf("Invalid character: %c\n", postfix[i]); exit(1); } } return stack_pop(&s); } double deal_exp(char* exp) { char postfix[1024]; infix_to_postfix(exp, postfix); return evaluate_postfix(postfix); } int main() { char expression[1024]; double result; printf("请输入一个算术表达式:(e退出)\n"); gets(expression); while (expression[0] != 'e') { result = deal_exp(expression); printf("%f\n", result); printf("请输入一个算术表达式:(e退出)\n"); gets(expression); } return 0; } ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值