baoligao @ 2019-11-11 20:07:13
It shouldn't be tagged "字符串" because l didn't use it.
#include <cstdio>
int
S[1024]
={ 0} ;;
int
p=
0;
char
c;
int
nn
;;
int
main
(){
for(c=0;c!='@';){ c=getchar();if
( c
=='@'
){; break
///
;} if (c
== '.'
){ S[
p] =nn;; ++
p; ;;
;; nn
=0 ;; ;} if
(c
==
'+'
){--p;if(p>0){S[p-
1]
+=
S[
p]
;} S[p]=0
;}
///
///
if(c=='-'){--p;if(p>0){
S[p-1]-=S[p];} S[p]=0;}
///
if (c
== '*'
){ --
p; if
(p>0
){ S[
p- 1]
*= S[ p];
}S[ p] =0;}
;
if
(c
=='/'){--p;if(p>0){
S[p-1]/=S[p];;}S[p]
=0
;}
;
if( c==
0 + '%'
){; --p
;if
(p>
0){ S[p
-1] %= S
[p] ;}S
[p] =0;}
;;
if((
c>
47
)
&&
(c
<
58
))
{nn*=10;
;
nn
+=
c-
48
;}
}printf("%d"
,S[0]);;;;
return
0;
}
Record: R26835175
by baoligao @ 2019-11-11 20:26:23
@Belarus l just passed those characters one by one.
by Belarus @ 2019-11-11 20:27:59
@baoligao 确实。但是你不觉得标签里写个”字符“过于片面吗?这题也可以全部读进去再处理啊,所以标签里”字符串“很合理啊
by baoligao @ 2019-11-11 20:36:23
@Belarus I didn't make it read the whole string at once. Also, it should not be tagged "stack" either.
by Belarus @ 2019-11-11 20:39:24
@baoligao 这题有多种做法不行吗?你认为标签就一定要是你做的方法吗?!
by baoligao @ 2019-11-11 20:57:41
@Belarus I really dislike those incorrect tags...... ...... ......
by WanderingTrader @ 2020-03-01 12:47:06
emmmm 我只想说,不会说中国话,不会写正常的代码,你上洛谷这个网站的目的是什(gao)么(xiao)
by WanderingTrader @ 2020-03-01 12:48:46
这种题目用搞笑解法纯属无聊 标准的栈和字符串题 (虽然我也只得60分,新手)
by dbxxx @ 2020-03-07 12:55:31
@baoligao 你在那里显摆什么英文,你没用标签里的做法,但是标签标字符串我觉得没有错误。因为这道题也可以用字符串做。
by y_kx_b @ 2022-08-22 11:37:07
《art》
烤谷*4