【HZNUOJ】第二章pro【IT名人】姚班难题
题面描述:求输入 T r u e True True 的个数
知识点:输入的用法,字符串函数 c m p cmp cmp
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define Paddi ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
signed main()
{
int n;
while (cin >> n)
{
int ans = 0;
for (int i = 1; i <= n; i++)
{
string s;
cin >> s;
if (s == "True")
ans++;
}
cout << ans << endl;
}
}
使用c语言的同学可以使用
strcmp(s,"True")
来实现对应功能