fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, firstNo, sumFriends = 0;
  6. cin >> a;
  7. firstNo = a;
  8. while (a != 0) {
  9. if (a % firstNo == 0) {
  10. ++sumFriends;
  11. }
  12. cin >> a;
  13. }
  14. cout << sumFriends;
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5284KB
stdin
4 8 3 5 4 0
stdout
3