請問哪裡有問題...一直過不了啊啊
#include<iostream>
#include<string>
using namespace std;
int main(){
char aa[200]{""};
cin >> aa;
int j = 0, p = 0, q = 0;
while (aa[j] != '\0')
{
if (aa[j]=='p')
p+=1;
else if(aa[j]=='q'){
if(p>0)
q+=1;
p-=1;
}
++j;
}
cout <<q;
}
謝謝