赞
踩
下面是用 C 语言实现的代码:
- #include <stdio.h>
- #include <string.h>
-
- int main()
- {
- int n;
- scanf("%d", &n);
-
- int count_a = 0, count_b = 0;
- char s[20]; // 存储输入的字符串
- for (int i = 0; i < n; i++) {
- scanf("%s", s);
- if (strcmp(s, "A") == 0) {
- count_a++;
- } else
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。