Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<math.h>
- #include<iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "RUS");
- int n, d, f, s;
- cout << "n="; cin >> n;
- d = n;
- s = 1;
- while (d > 0 or d<0)
- {
- f = d % 10;
- s *= f;
- d /= 10;
- if(s<0)
- {
- s *= -1;
- }
- }
- cout << "Произведение цифр числа=" << s << "\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement