Advertisement
Chessbrain94

Trece Pitanje

Jan 26th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #include<iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7.  
  8. void unos(char M[], int Size)
  9. {
  10. for (int i = 0; i < Size; i++)
  11. {
  12. cin >> M[i];
  13.  
  14.  
  15. }
  16. }
  17.  
  18. int Rest(char M[], int Size)
  19. {
  20. int counter2 = 0;
  21.  
  22. for (int i = 0; i < Size; i++)
  23. {
  24.  
  25. if (M[i] < 'a' || M[i] > 'z')
  26. {
  27. counter2++;
  28. }
  29.  
  30. }
  31. return counter2;
  32. }
  33.  
  34. int Count(char M[], int Size)
  35. {
  36. int counter = 0;
  37.  
  38. for (int i = 0; i < Size; i++)
  39. {
  40. if (M[i] >= 'a' && M[i] <= 'z')
  41. {
  42. counter++;
  43. }
  44. }
  45. return counter;
  46. }
  47.  
  48. int main()
  49. {
  50. const int Size = 7;
  51.  
  52. char Array[Size];
  53.  
  54. unos(Array, Size);
  55.  
  56. Count(Array, Size);
  57.  
  58. Rest(Array, Size);
  59.  
  60. cout << endl;
  61.  
  62. cout << Count(Array, Size) << endl;
  63.  
  64. cout << endl;
  65.  
  66. cout << Rest(Array, Size) << endl;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement