Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdlib.h>
  2.  
  3. #include <stdio.h>
  4.  
  5.  
  6.  
  7.  
  8. int main()
  9. {
  10.     int i = 0;
  11.     char arr[101];
  12.     scanf("%s", arr);
  13.     if (arr==NULL){
  14.         printf("0"); return(0);}
  15.     else
  16.     {
  17.         while (arr[i]!='\0')
  18.         {
  19.             i++;
  20.        
  21.         }
  22.     }
  23.     if (i>100) return 0; //Если символов больше ста, то программа просто завершается.
  24.     if (i<0) printf("0");
  25.     else printf ("Length: %d", i);
  26.  
  27.  
  28.     return(0);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement