hdu 1237 简单计算器
来源:互联网 发布:山东博达网络 编辑:程序博客网 时间:2024/05/16 09:12
http://acm.hdu.edu.cn/showproblem.php?pid=1237
分析:看来对栈的应用还是不熟练,汗颜啊
#include <iostream>#include <cstdio>#include <cstring>using namespace std;int main(){double s[205],t;char f;int i,j;while( cin >> t ){f=getchar( );if( f == '\n' && t == 0 ) //break;memset( s,0,sizeof(s) );s[0] = t;i=0;while( 1 ){cin >> f >> t;if( f == '*' ) s[i] *= t;else if( f == '/' ) s[i] /= t;else if( f == '+' ) s[++i] = t;else s[++i] = -t;if( getchar( ) == '\n' )break;}t=0.0;for( j = 0;j <= i;j++ )t += s[j];printf( "%.2lf\n",t );}return 0;}
- HDU 1237 简单计算器
- HDU 1237 简单计算器
- hdu 1237 简单计算器
- HDU 1237 简单计算器
- hdu 1237 简单计算器
- hdu 1237 简单计算器
- hdu - 1237 - 简单计算器
- hdu 1237 简单计算器
- HDU-简单计算器-1237
- hdu 1237简单计算器
- hdu 1237 简单计算器
- hdu 1237 简单计算器
- HDU 1237 简单计算器
- HDU 1237简单计算器
- hdu 1237 简单计算器
- HDU 1237 简单计算器
- HDU-1237-简单计算器
- HDU-1237-简单计算器
- make[1]: *** [/usr/local/pcre//Makefile] Error 127
- hdu 4090 bfs+dfs+状态压缩+hash判重
- Uva - 1416 Warfare And Logistics dijkstra维护..题目范围有误..
- 静态和非静态方法
- 警告: Error setting expression 'schance.chc_status' with value '[Ljava.lang.String;@13e6346'
- hdu 1237 简单计算器
- IE核心不支持JSON.parse方法
- Android中的请求码与结果码
- 奇数幻方(魔方阵)算法
- 프로그래머 되가는길은 참고독하다. 그래서 널만들엇다 나의좋은친구되주길.
- java的体验!
- cocos2d-x TestLua 之 CCMenuItemToggle菜单类
- 解决word2007里空格变成小灰点
- 中国人的java新体验!