Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, a;
- int produs = 1;
- cout << "Introdu n: "; cin >> n;
- for (int i = 0; i < n; i++)
- {
- cout << "Introdu a: "; cin >> a;
- if (a % 10 == 3) // 1234 % 10 = 4; 5512 % 10 = 2; 2142 % 100 = 42; 3 % 100 = 0.3
- {
- produs = produs * a;
- }
- }
- cout << "Produs: " << produs << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment