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 | #include <iostream> using namespace std; #define SIZE 9 int main() { int arr[SIZE]; int max = 0, index = 0; for (int i = 0; i < SIZE; i++) { cin >> arr[i]; if (max < arr[i]) { max = arr[i]; index = i; } } cout << max << endl << index + 1 << endl; return 0; } | cs |