mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-08 02:13:51 +08:00
Update: Rename folder name to XSMOJ
This commit is contained in:
21
XSMOJ/希蒙的AC贴纸数.cpp
Normal file
21
XSMOJ/希蒙的AC贴纸数.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
#define int long long
|
||||
using namespace std;
|
||||
|
||||
signed main()
|
||||
{
|
||||
char a[1005];
|
||||
scanf("%[^\n]", &a);
|
||||
int i = 0, cnt = 0;
|
||||
while(a[i] != '\0')
|
||||
{
|
||||
if(((a[i] == 'A' && a[i + 1] == 'C') || a[i] == a[i + 1]) && a[i] != ' ')
|
||||
{
|
||||
cnt ++ ;
|
||||
}
|
||||
i ++ ;
|
||||
}
|
||||
cout << cnt ;
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user