Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>          
  3.  
  4. using namespace std;
  5.  
  6. int NumberOfDigits = 0;
  7. int Reverse();
  8.  
  9. int main() {
  10.     cout << "Write text ";
  11.     int NumberOfDigits = Reverse();
  12.     cout << "Number of numbers in text:" << NumberOfDigits<<endl;
  13.     system("pause");
  14. }
  15.  
  16.     int Reverse() {
  17.         char text;
  18.         cin >> text;
  19.         if (text != '.')
  20.         {
  21.             if (isdigit(text)) {
  22.                 NumberOfDigits++;
  23.             }
  24.             Reverse();
  25.         }
  26.         return NumberOfDigits;
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement