This commit is contained in:
Zengtudor 2024-10-06 00:08:55 +08:00
parent 5d4dd86657
commit 8aeca62d3b
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ build
!.gitignore !.gitignore
*.json *.json
/cmake-build* /cmake-build*
/build*

View File

View File

@ -6,7 +6,7 @@
using std::cin, std::cout, std::string, std::vector, std::iostream; using std::cin, std::cout, std::string, std::vector, std::iostream;
constexpr auto range = std::ranges::views::iota; constexpr auto range = std::ranges::views::iota;
int n; size_t n;
string s; string s;
int a_num, b_num; int a_num, b_num;
char max_char, min_char; char max_char, min_char;
@ -28,7 +28,7 @@ int main(){
iostream::sync_with_stdio(false), cin.tie(0), cout.tie(0); iostream::sync_with_stdio(false), cin.tie(0), cout.tie(0);
cin>>n; cin>>n;
cin>>s; cin>>s;
for(const int i:range(0,n)){ for(const int i:range((size_t)0,n)){
if(s[i]=='A') { if(s[i]=='A') {
a_num++; a_num++;
}else if(s[i]=='B'){ }else if(s[i]=='B'){