题目传送门

#include <bits/stdc++.h>

using namespace std;
int a[3];
char s1, s2;

int main() {
    //充分利用c++语言优势
    while (scanf("%c:=%c;", &s1, &s2) == 2)
        //赋值语句简洁明了
        a[s1 - 'a'] = s2 >= '0' && s2 <= '9' ? s2 - '0' : a[s2 - 'a'];
    //此方法只对赋值1位有效
    printf("%d %d %d", a[0], a[1], a[2]);
}

相关文章:

  • 2022-12-23
  • 2022-01-05
  • 2021-06-11
  • 2021-06-02
  • 2021-06-27
  • 2021-12-31
  • 2021-09-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
相关资源
相似解决方案