题意:
给出 1 , 2 , 3 1,2,3 1,2,3中的两个,问剩下的第三个。
思路:
你可以用 i f − e l s e if-else if−else 嵌套,可以用桶标记,可以……反正水题一个。
时间复杂度: O ( 1 ) O(1) O(1)
#include <bits/stdc++.h>
using namespace std;
#define int long long
bool st[4];
signed main() {
int a,b;
cin>>a>>b;
st[a]=true,st[b]=true;
for(int i=1;i<=3;i++)
if(!st[i]) cout<<i;
return 0;
}