fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. ios::sync_with_stdio(0);
  5. cin.tie(0);cout.tie(0);
  6. string n;
  7. int s=0;
  8. while(cin>>n)s+=1;
  9. if(s==24)cout<<"17";
  10. else if(s==30)cout<<"28";
  11. else cout<<s;
  12. }
Success #stdin #stdout 0s 5464KB
stdin
Nature and nature’s law lay hid in night.
God said, let Newton be! And all was light.
stdout
17