Advertisement
ZhilinskiyG

Dlina stroki

Apr 9th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. using namespace std;
  4. int lenght(char str[])
  5. {
  6.     int z=0;
  7.     while (str[z] != '\0'){
  8.         z++;
  9.     }
  10.     return z;
  11. }
  12. int _tmain(int argc, _TCHAR* argv[])
  13. {
  14.     char str[200];
  15.     cin.getline(str,200);
  16.     cout << lenght(str);
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement