#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll i,j,k,l,m,n,test;
cin>>test;
for(k=1;k<=test;k++)
{
string s;
cin>>n>>s;
ll cnt=0;
for(i=0;i<s.size();i++)
{
if(s[i]=='#')
cnt++;
}
cout<<"Case "<<k<<": ";
if(cnt==n)
{
cout<<0<<endl;
continue;
}
else
{
ll ans=0;
for(i=0;i<n;i++)
{
//cout<<i<<endl;
if(s[i]=='.')
{
//cout<<"AAA:"<<i<<endl;
ans++;
i+=2;
}
}
cout<<ans<<endl;
}
}
return 0;
}
using namespace std;
typedef long long ll;
int main()
{
ll i,j,k,l,m,n,test;
cin>>test;
for(k=1;k<=test;k++)
{
string s;
cin>>n>>s;
ll cnt=0;
for(i=0;i<s.size();i++)
{
if(s[i]=='#')
cnt++;
}
cout<<"Case "<<k<<": ";
if(cnt==n)
{
cout<<0<<endl;
continue;
}
else
{
ll ans=0;
for(i=0;i<n;i++)
{
//cout<<i<<endl;
if(s[i]=='.')
{
//cout<<"AAA:"<<i<<endl;
ans++;
i+=2;
}
}
cout<<ans<<endl;
}
}
return 0;
}
No comments:
Post a Comment