fork download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main() {
  6. int k=0;
  7. char s[251];
  8. cin.getline (s, 251);
  9. for (int i=0; i<strlen(s); i++)
  10. if((s[i]==33 or s[i]==46 or s[i]==63) and ((s[i-1]>=65 && s[i-1]<=90) or (s[i-1]>=97 && s[i-1]<=122) or(s[i-1]>=48 && s[i-1]<=57))) k++;
  11. cout << k;
  12. return 0;
  13. }
Success #stdin #stdout 0s 4264KB
stdin
7 2
5 6
3 4
2 5
1 3
9 3
8 7
6 4
stdout
Standard output is empty