|
|
back to boardadmins, my programm outputs correct answers on all the possible test cases but here I get WA2 What is in test 2 ?????????????????? YOUR TEST CASES ARE WROUNG MY PROGRAMM IS CORRECT !! my code: #include <iostream> #include <string> using namespace std; int main(int argc, char *argv[]) { string sent; char c = 0; size_t count = 0; while (cin.get(c)) { sent.push_back(c); if (c == '.' || c == '?' || c == '!') { size_t i = 0; while (i < sent.size() && !isalpha(sent[i])) { i++; } if (i < sent.size() && islower(sent[i])) count++;
string word = ""; for (size_t i = 0; i < sent.size() + 1; i++) { if (i < sent.size() && (isalpha(sent[i]))) { word += sent[i]; } else { for (size_t j = 1; j < word.size(); j++) { if (isupper(word[j]) && isalpha(word[j])) count++; } word = ""; } } sent.clear(); //cout << count << endl; } } cout << count; return 0; } Edited by author 12.06.2015 20:13 Edited by author 12.06.2015 20:13 |
|
|