Fork me on GitHub

  2013年2月21日
摘要: 题目29:计算表达式时间限制:1 秒内存限制:32 兆特殊判题:否提交:909解决:333题目描述:对于一个不存在括号的表达式进行计算输入:存在多种数据,每组数据一行,表达式不存在空格输出:输出结果样例输入:6/2+3+3*4样例输出:18#include <stdio.h>int main(){ int i,j,k,a[100]; char x; while(scanf("%d",&k)!=EOF) { a[0]=0; i=0; a[++i]=k; while(scanf("%c",&x)!=EOF&&(x= 阅读全文
posted @ 2013-02-21 15:49 huashiyiqike 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 还可以用指针++#include <stdlib.h>#include <stdio.h>#include <math.h>#include<string.h>#include <algorithm>#include <queue>using namespace std;#define ll long longpriority_queue<ll,vector<ll>,greater<ll> > pi;int main( ){ //freopen("in.txt",&q 阅读全文
posted @ 2013-02-21 10:56 huashiyiqike 阅读(147) 评论(0) 推荐(0) 编辑