Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
#include <iostream> #include <string> #include <iomanip> #include <cmath> using namespace std; int main ( ) { char *s; s = new char[50]; cin >> s; int d = 0; while (*s++) d++; cout << d; }
new char[50]
string
for(int i=0; i < 50; i++) { if(s[i]=='\0') break; cout << s[i]<< endl; }