第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如下代碼,為什么會(huì)出現(xiàn)這個(gè)錯(cuò)誤呢?求解釋!

如下代碼,為什么會(huì)出現(xiàn)這個(gè)錯(cuò)誤呢?求解釋!

PHP
寶慕林4294392 2023-03-17 22:18:46
#include <stdio.h>#include <math.h>#include <ctype.h>#define NUMBER '0'#define MAXLEN 1000#define BUFSIZE 100int getch(void);void ungetch(int);int getline(char *);void push(double );double pop(void );void ungets(char *);double atof(char s[]);char buf[BUFSIZE];int bufp = 0;#define MAXVAL 100int sp = 0;double val[MAXVAL];main(int argc,char *argv[]){char s[MAXLEN];double op2;while(--argc > 0){ungets(" ");ungets(*++argv);switch(getline(s)){case NUMBER : push(atof(s));break;case '+' :push(pop() + pop());break;case '-' :op2 = pop();push(pop() - op2);break;case '*' :push(pop() * pop());break;case '/' :op2 = pop();if(op2 != 0.0)push(pop() / op2);else printf("error : zero divisor \n");break;default :printf("erro : unkown command %s\n",s);argc = 1;break;}}printf("\t%.8g\n",pop());return 0;}int getop(char s[]){int i,c;while((s[0] = c =getch()) == ' ' || c == '\t');s[1] = '\0';if( !isdigit(c) && c != '.')return c;i = 0;if(isdigit(c))while(isdigit(s[++i] = c = getch()));if(c == '.')while(isdigit(s[++i] = c =getch()));s[i] = '\0';if(c != EOF)ungetch(c);return NUMBER;}int getch(void){return (bufp > 0) ? buf[--bufp] : getchar();}void ungeth(int c){if(bufp >= BUFSIZE)printf("ungetch : too many characters\n");elsebuf[bufp++] = c;}void push(double f){if(sp < MAXVAL)val[sp++] = f;elseprintf("error: stack full , can't push %g\n");}double pop(){if(sp > 0)return val[--sp];else{printf("error: stack empty\n");return 0.0;}}double atof(char s[]){double val,power;int i,sign;for(i = 0; isspace(s[i]);i++);sign = (s[i] == '-') ? -1 : 1;if(s[i] == '+' ||s[i] == '-')i++;for(val = 0.0;isdigit(s[i]);i++)val = 10.0 * val + s[i] - '0';if(s[i] == '.'){i++;for(power = 1.0 ;isdigit(s[i]);i++){val = 10.0 * val + s[i] - '0';power *= 10.0 ;}}return sign * val / power;}
查看完整描述

2 回答

?
MMTTMM

TA貢獻(xiàn)1869條經(jīng)驗(yàn) 獲得超4個(gè)贊

有重復(fù)聲明的函數(shù),如double atof(char s[]),把這個(gè)改個(gè)名,這個(gè)告警不會(huì)有了

查看完整回答
反對(duì) 回復(fù) 2023-03-21
?
呼如林

TA貢獻(xiàn)1798條經(jīng)驗(yàn) 獲得超3個(gè)贊

沒事的,你的程序沒有錯(cuò)誤

查看完整回答
反對(duì) 回復(fù) 2023-03-21
  • 2 回答
  • 0 關(guān)注
  • 320 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)