Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <iostream>
- using namespace std;
- class Long
- {
- private:
- long long int a;
- public:
- Long (long long int n)
- {
- a = n;
- }
- void counter()
- {
- int count = 0;
- if (a == 0)
- {
- count = 1;
- cout << "N = " << count;
- }
- else
- {
- while (a!=0)
- {
- count++;
- a = a/10;
- }
- cout << "N = " << count;
- }
- }
- void out()
- {
- cout << "n = " << a << endl;
- }
- };
- int main()
- {
- long long int n;
- cin >> n;
- Long alf(n);
- alf.out();
- alf.counter();
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement