#S0012. 天气预报解析
天气预报解析
1. Description
Create a smart weather report analyzer. Input 7-day weather data (date+temperature+weather type), output:
- Average temperature (1 decimal)
- Max temperature with date
- Weather type frequency dictionary (e.g {"Sunny":3, "Rain":2})
Valid weather types: Sunny/Rain/Cloudy/Snow/Fog. Skip invalid entries (ensure ≥3 valid days).
2. Input & Output
Input:
- Space-separated values (daily format: YYYY-MM-DD,temp,weather)
days = input().split()
Output:
- Three lines for the three results
Example
# Input:
2023-12-25,5,Sunny 2023-12-26,8,Cloudy 2023-12-27,3,Rain
# Output:
5.3
8 2023-12-26
{'Sunny':1, 'Cloudy':1, 'Rain':1}
# Input:
2023-01-01,-2,Snow InvalidData 2023-01-03,10,Fog
# Output:
4.0
10 2023-01-03
{'Snow':1, 'Fog':1}