Guest User

Untitled

a guest
Aug 15th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include "stdafx.h"
  2.  
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int tan = 255, cont = 0;
  9. char entrada[tan];
  10. //inicializamos el arreglo con espacios en blanco
  11. for (int i = 0; i<tan; i++)
  12. entrada[i] = ' ';
  13.  
  14. cout << "Ingrese caracteres: ";
  15. cin.getline(entrada, tan);
  16. for (int i = 0; i<tan; i++)
  17. if (entrada[i] != ' ')
  18. cont++;
  19.  
  20. cout << "La cantidad de caracteres: " << --cont;
  21. }
Add Comment
Please, Sign In to add comment