tungggg

file

May 17th, 2022
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4.     string s ;
  5.     cin >> s ;
  6.    
  7.     ifstream f (s );
  8.     if ( f ){
  9.         int n;
  10.         f>> n ;
  11.         f.ignore();
  12.         for (int i=0;i<n;i++){
  13.             int countNames = 0 ;
  14.             string thisLine ; getline(f,thisLine);
  15.             stringstream ss ( thisLine );
  16.             string t ;
  17.             while ( ss >> t ){
  18.                 if ( t.size()>=2 && isupper(t[0]) ){
  19.                     countNames ++;
  20.                 }
  21.             }
  22.             cout << countNames << endl;
  23.         }
  24.     }
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment