---
# System prepended metadata

title: First ABC

---

# First ABC 
## [題目連結](https://atcoder.jp/contests/abc311/tasks/abc311_a)
## 解題想法
* 用0和1紀錄各個字是否出現過
## 花費的時間：5分鐘
## 程式碼
```cpp=01
#include<cstdio>
int main(){
    int n,i,a=0,b=0,c=0;
    scanf("%d",&n);
    char w[n];
    scanf("%s",w);
    for(i=0;i<n;i++){
        if(w[i]=='A')a=1;
        else if(w[i]=='B')b=1;
        else if(w[i]=='C')c=1;
        if(a*b*c==1)break;
    }
    printf("%d",i+1);
}
