Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <cstdio>#include <cstring>using namespace std;enum {maxn = 1000+5};char s[maxn];int count[3];int stack[1000];int top = -1;int main(){//freopen("in.txt", "r", stdin);gets(s);char * c = s;count[0] = count[1] = count[2] = 0;while(*c){while(*c && *c != '<'){if (top >= 0 && *c != ' ')count[stack[top]]++;c++;}if (*c == '<') c++;switch(*c){case '/':top--;break;case 'r':stack[++top] = 0;break;case 'y':