fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(void)
  6. {
  7. int a, arr[42] = { 0, }, cnt = 0;
  8.  
  9. for(int i = 0; i < 10; i++)
  10. {
  11. cin >> a;
  12. arr[a % 42] = 1;
  13. }
  14.  
  15. for(int i = 0; i < 42; i++)
  16. if (arr[i])
  17. cnt++;
  18.  
  19. cout << cnt;
  20. return 0;
  21. }
Success #stdin #stdout 0s 4928KB
stdin
42
84
252
420
840
126
42
84
420
126
stdout
1