博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
东北赛选拔教训
阅读量:4047 次
发布时间:2019-05-25

本文共 1362 字,大约阅读时间需要 4 分钟。

一个小模拟,计算表达式的值,一直到最后没做出来,检查好半天才发现就是一个字幕结束符标错了!!!!虽然多做上这一道题并不会有多大优势,但是还是会觉得因为这一点点错误就没坐上特比特别的可惜,不要不在意这一点点马虎,这就是你没有实力的表现,实力就是能力加细节!!!吸取教训

HDU 3347#include
#include
#include
#include
#include
using namespace std;int main(){ int t; scanf("%d",&t); while(t--) { int n; string s; map
mp; mp.clear(); scanf("%d",&n); for(int i=0;i
>s; char a; int value; scanf(" %c ",&a); scanf("%d",&value); mp[s]=value; } getchar(); char ano[500]; char tmp[30]; gets(ano); int k=1; int len=strlen(ano); long long sum=0; int first=0; int haha=0; for(int i=0;i
='a'&&ano[i]<='z') { //puts("a3"); for(int j=i;;j++) { if(ano[j]==' ') {tmp[haha]='\0';i=j+1;break;} //这里把haha写成j了!!!! else if(ano[j]>='a'&&ano[j]<='z') tmp[haha++]=ano[j]; } if(k==1) sum+=mp[tmp]; else if(k==2) sum-=mp[tmp]; haha=0; } else if(ano[i]=='-') { //puts("a4"); int mm=0; for(int j=i;;j++) { if(ano[j]==' ') {i=j+1;break;} else if(ano[j]>='0'&&ano[j]<='9') mm=mm*10+(ano[j]-'0'); } mm=-mm; if(k==1) sum+=mm; else if(k==2) sum-=mm; } else if(ano[i]>='0'&&ano[i]<='9') { //puts("a5"); int tmp=0; for(int j=i;;j++) { if(ano[j]==' ') {i=j+1;break;} else if(ano[j]>='0'&&ano[j]<='9') tmp=tmp*10+(ano[j]-'0'); } if(k==1) sum+=tmp; else if(k==2) sum-=tmp; } } printf("%lld\n",sum); } return 0;}/*53aa = 7bb = -0-10 - -9 - bb + aa = ?*/

转载地址:http://lcbci.baihongyu.com/

你可能感兴趣的文章
Promise的基本使用
查看>>
coursesa课程 Python 3 programming 统计文件有多少单词
查看>>
coursesa课程 Python 3 programming 输出每一行句子的第三个单词
查看>>
Returning a value from a function
查看>>
coursesa课程 Python 3 programming Functions can call other functions 函数调用另一个函数
查看>>
coursesa课程 Python 3 programming The while Statement
查看>>
course_2_assessment_6
查看>>
coursesa课程 Python 3 programming course_2_assessment_7 多参数函数练习题
查看>>
coursesa课程 Python 3 programming course_2_assessment_8 sorted练习题
查看>>
在unity中建立最小的shader(Minimal Shader)
查看>>
1.3 Debugging of Shaders (调试着色器)
查看>>
关于phpcms中模块_tag.class.php中的pc_tag()方法的含义
查看>>
vsftp 配置具有匿名登录也有系统用户登录,系统用户有管理权限,匿名只有下载权限。
查看>>
linux安装usb wifi接收器
查看>>
多线程使用随机函数需要注意的一点
查看>>
getpeername,getsockname
查看>>
让我做你的下一行Code
查看>>
浅析:setsockopt()改善程序的健壮性
查看>>
关于对象赋值及返回临时对象过程中的构造与析构
查看>>
VS 2005 CRT函数的安全性增强版本
查看>>