#include<bits/stdc++.h>
using namespace std;
#define int long long
int s[100][2]={0};
signed main(){
ios::sync_with_stdio(0),cin.tie(0);
char aa;
int a=0,c=0,f=0;
while((aa=getchar())!='\n'){
if(aa=='A')a++;
else if(aa=='C')c++;
else if(aa=='F'){
s[f][0]=c,s[f][1]=a;
f++;
}
}
s[f][0]=c,s[f][1]=a;
for(int i=0;i<f;i++)cout<<s[f][0]-s[i][0]<<" "<<s[f][1]-s[i][1]<<'\n';
return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define int long long
int s[100][2]={0};
signed main(){
ios::sync_with_stdio(0),cin.tie(0);
char aa;
int a=0,c=0,f=0;
while((aa=getchar())!='\n'){
if(aa=='A')a++;
else if(aa=='C')c++;
else if(aa=='F'){
s[f][0]=c,s[f][1]=a;
f++;
}
}
s[f][0]=c,s[f][1]=a;
for(int i=0;i<f;i++)cout<<s[f][0]-s[i][0]<<" "<<s[f][1]-s[i][1]<<'\n';
return 0;
}
可以確定的是,你陣列開太小