当前位置:首页 > 编程笔记 > 正文
已解决

1016 部分A+B

来自网友在路上 151851提问 提问时间:2023-10-21 20:23:10阅读次数: 51

最佳答案 问答题库518位专家为你答疑解惑

#include<bits/stdc++.h>
using namespace std;
int main(){string str1;string str2;int a,b;cin>>str1>>a>>str2>>b;int a1=0;int a2=0;for(auto t:str1){if(t-'0'==a){a1=a1*10+a;}}for(auto t:str2){if(t-'0'==b){a2=a2*10+b;}}cout<<a1+a2;
}

查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"1016 部分A+B":http://eshow365.cn/6-21023-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!