Головна » Статті » С++ » Приклади програм |
Вивести довжину рядка без врахування пробiлів С++
#include <iostream> #include <cstring> #include <cstdio> using namespace std; int main() { char str[50]; gets(str); int j=0; for(int i=0; i<strlen(str); i++) if(str[i]==' ') j++; cout<<strlen(str)-j; } | |
Переглядів: 172 | | |
Всього коментарів: 0 | |