PAT1003我要通过!
2017-02-11 14:24
357 查看
#include <iostream> #include <string> using namespace std; string test(char* x) { int a = 0; while (*x != 'P') { if(*x != 'A') { return "NO\n"; } else a++; x++; } x++; int b = 0; while (*x != 'T') { if(*x != 'A') { return "NO\n"; } else b++; x++; } x++; int c = 0; while (*x != '\0') { if(*x != 'A') { return "NO\n"; } else c++; x++; } if (a*b == c && b != 0) return "YES\n"; else return "NO\n"; } int main() { int n = 0; cin >> n; char s[10][100] = {0}; int i = 0; while(n--) { cin >> s[i++]; } n = 0; while(i--) { cout<<test(s[n++]); } return 0; }
相关文章推荐
- PAT 1003. 我要通过!
- PAT (Basic Level) Practise (中文) 1003.我要通过!(20)
- PAT甲级C语言.1003. 我要通过!
- PAT 1003 我要通过
- pat 乙 1003. 我要通过!
- 1003. 我要通过!(20) PAT
- [PAT乙级]1003. 我要通过!(20)
- PAT(B) 1003. 我要通过!(模拟题)
- PAT 乙级1003 我要通过
- 1003. 我要通过!(20)-PAT乙级
- PAT 1003. 我要通过!(20)
- PAT:1003我要通过
- PAT 1003我要通过!
- PAT(乙) 1003.我要通过!(20)
- PAT训练(乙级)—— 1003. 我要通过!(20)
- PAT 1003. 我要通过!(20)
- 1003. 我要通过!(20)-浙大PAT乙级真题
- PAT 1003 我要通过
- 1003. 我要通过!(20)--PAT乙级
- PAT乙级—1003. 我要通过!(20)-native