出现次数最多的整数#include int main() { int n; scanf("%d", &n); int arr[n]; for (int i = 0; i < n; i++) { scanf("%d", &arr[i]); } int maxCount = 0; int mostFrequentNumber; for (int i = 0; i < n; i++) { int count = 1; for (int j = i + 1; j < n; j++) { if (arr[i] == arr[j]) { count++; } } if (count > maxCount) { maxCount = count; mostFrequentNumber = arr[i]; } } printf("%d %d", mostFrequentNumber, maxCount); return 0;}