还在因为 if 太多而感到自己抽象 吗

coder · 发布于 2024-11-09 · 浏览 414 回复 0
//
// Created by Administrator on 2024/11/8.
//
#include "bits/stdc++.h"
using namespace std;
int a[300][300] = {0};
int main(){
   int n;
   cin >> n;
    while (n--){
        string s;
        cin >> s;
        a[s[0]][s[1]] = 1;
    }
    int cnt = 0;
    for (int i = 0; i < 300; ++i) {
        for (int j = 0; j < 300; ++j) {
            if(a[i][j]==1){
                cnt++;
            }
        }
    }
    cout << 52-cnt;
}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复