标签:out get names set 部分 tar tps ring style
题目链接:https://pintia.cn/problem-sets/994805260223102976/problems/994805306310115328
题解:
1 #include <iostream> 2 #include<string> 3 using namespace std; 4 5 int main() { 6 string A, B; 7 int DA, DB; 8 cin >> A >> DA >> B >> DB; 9 int nDA = 0, nDB = 0; 10 for (int i = 0; i < A.size(); i++) 11 if (A[i] - 48 == DA) 12 nDA++; 13 for (int i = 0; i < B.size(); i++) 14 if (B[i] - 48 == DB) 15 nDB++; 16 17 int numA = 0, numB = 0, a = 1, b = 1; 18 for (int i = 0; i < nDA; i++) { 19 numA += a * DA; 20 a *= 10; 21 } 22 for (int i = 0; i < nDB; i++) { 23 numB += b * DB; 24 b *= 10; 25 } 26 cout << numA + numB; 27 return 0; 28 }
标签:out get names set 部分 tar tps ring style
原文地址:https://www.cnblogs.com/Gzu_zb/p/9542689.html