Advertisement
Guest User

dziesionte

a guest
Jan 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5. int main(){
  6. int endinput=0;
  7. int cyfry=0,male=0,duze=0, biale=0;
  8. string text="";
  9. while(endinput!=3){
  10. getline(cin,text);
  11. if(text=="\0"){
  12. endinput+=1;
  13. }
  14. else{
  15. endinput=0;
  16. for(int i=0;i<text.length();i++){
  17. if(isdigit(text[i])) cyfry++;
  18. else if(isupper(text[i])) duze++;
  19. else if(islower(text[i])) male++;
  20. else if(isspace(text[i])) biale++;
  21. }
  22. }
  23. }
  24. cout<<"Wprowadzono: "<<cyfry<<" cyfr \n";
  25. cout<<"Wprowadzono: "<<male<<" malych liter \n";
  26. cout<<"Wprowadzono: "<<duze<<" duzych liter \n";
  27. cout<<"Wprowadzono: "<<biale<<" bialych znakow \n";
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement