1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #include <iostream> using namespace std; int N[10]; int r[42] ={0,}; int k = 0; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); for (int i = 0; i < 10; i++) { while (1) { cin >> N[i]; if (0 <= N[i] && N[i] <= 1000) break; } N[i] = N[i] % 42; } for (int i = 0; i < 10; i++) { for (int j = 0; j < 42; j++) { if (N[i] == j) r[j] = r[j] + 1; } } for (int i = 0; i < 42; i++) { if (r[i] != 0) { k++; } } cout << k; return 0; } | cs |