Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- int tan = 255, cont = 0;
- char entrada[tan];
- //inicializamos el arreglo con espacios en blanco
- for (int i = 0; i<tan; i++)
- entrada[i] = ' ';
- cout << "Ingrese caracteres: ";
- cin.getline(entrada, tan);
- for (int i = 0; i<tan; i++)
- if (entrada[i] != ' ')
- cont++;
- cout << "La cantidad de caracteres: " << --cont;
- }
Add Comment
Please, Sign In to add comment