You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#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]);
|
|
return 0;
|
|
} |