fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <cstring>
  4. using namespace std;
  5.  
  6. void permutate(char &);
  7. int getlength(char []);
  8.  
  9. int main ()
  10. {
  11. char array[20];
  12.  
  13. int length=getlength(array);
  14.  
  15.  
  16. cin>>array;
  17.  
  18.  
  19. cout<<length
  20. <<endl;
  21.  
  22.  
  23.  
  24. /*for (int i=0;i<200;i++)
  25. {
  26. cout<<array[i];
  27. }
  28. */
  29.  
  30.  
  31.  
  32.  
  33.  
  34. system("PAUSE");
  35.  
  36. }
  37.  
  38. void permutate(char &array)
  39. {
  40.  
  41.  
  42.  
  43.  
  44. }
  45.  
  46. int getlength(char array[])
  47. {
  48. int i=0;
  49. int count=0;
  50.  
  51. while (array[i] != '\0')
  52. {
  53. count++;
  54. i++;
  55.  
  56. }
  57.  
  58. return count;
  59.  
  60.  
  61.  
  62. }
Success #stdin #stdout 0.02s 5268KB
stdin
Standard input is empty
stdout
49