Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  vector<double> tem(12);

  cout << "月別の平均気温(℃)を１２個、１月から１２月まで順番に小数で入力してください。" << endl;
  cin >> tem.at(0) >> tem.at(1) >> tem.at(2) >> tem.at(3) >> tem.at(4) >> tem.at(5) >> tem.at(6) >> tem.at(7) >> tem.at(8) >> tem.at(9) >> tem.at(10) >> tem.at(11);

  vector<double> pre(12);

  cout << "月別の降水量(㎜)を１２個、１月から１２月まで順番に小数で入力してください。" << endl;
  cin >> pre.at(0) >> pre.at(1) >> pre.at(2) >> pre.at(3) >> pre.at(4) >> pre.at(5) >> pre.at(6) >> pre.at(7) >> pre.at(8) >> pre.at(9) >> pre.at(10) >> pre.at(11);

  double r;
  r = pre.at(0) + pre.at(1) + pre.at(2) + pre.at(3) + pre.at(4) + pre.at(5) + pre.at(6) + pre.at(7) + pre.at(8) + pre.at(9) + pre.at(10) + pre.at(11);

  double P;
  P = pre.at(3) + pre.at(4) + pre.at(5) + pre.at(6) + pre.at(7) + pre.at(8);
  double t;
  t = (tem.at(0) + tem.at(1) + tem.at(2) + tem.at(3) + tem.at(4) + tem.at(5) + tem.at(6) + tem.at(7) + tem.at(8) + tem.at(9) + tem.at(10) + tem.at(11) )/12;

double mintem;
double maxtem;

  double mintem = *std::min_element(tem.begin(), tem.end());
  double maxtem = *std::max_element(tem.begin(), tem.end());

double minpre;
double maxpre;

double minpre = *min_element(pre.begin(), pre.end());
double maxpre = *max_element(pre.begin(), pre.end());

double R;
//ここからSTEP１
string dry;
  if (P / r >= 0.7){
    dry = "w";
    R = (t + 14) * 20;
    cout << "乾燥限界値は" << endl;
    cout << R << endl;
  }else if (P / r >= 0.3){
    dry = "f";
  R = (t + 7) * 20;
  cout << "乾燥限界値は" << endl;
  cout << R << endl;
  }else{
    dry = "s";
  R = t * 20;
  cout << "乾燥限界値は" << endl;
  cout << R << endl;
  }
string wea;
if (R>r) {
    wea = "B";
}

//ここからSTEP2

if (maxtem < 10) {
    wea = "E";
}
//ここからSTEP3

if (mintem >= 18){
    wea = "A";
}else if (mintem < -3){
    wea = "D";
}else{ wea = "C";
}
//ここからSTEP4

if (wea = "A"){
    if (minpri >= 60){
        cout << "Af 熱帯雨林気候区です" << endl;
    }else if(100 * minpre < 10000 - 4 * r){
        cout << "Aw サバナ気候区です" << endl;
    }else{
        cout << "Am 弱い乾季のある熱帯雨林気候区です" << endl;
    }
}
if (wea = "B"){
    if (R / 2 <= r){
        cout << "BS ステップ気候です" << endl;
    }else{
        cout << "BW 砂漠気候です" << endl;
    }
}
if (wea = "C"){
    if (dry = "s" && minpre < 30){
        cout << "Cs 地中海性気候区です" << endl;
    }else if (dry = "w"){
        cout << "Cw 温暖冬季少雨気候区です" << endl;
    }else if (dry = "f" && maxtem >= 22){
        cout << "Cfa 温暖湿潤気候区です" << endl;
    }else{
        cout << "Cfb 西岸海洋性気候区です" << endl;
    }
}
if (wea = "D"){
    if (dry = "f"){
        cout << "Df 亜寒帯湿潤気候区です" << endl;
    }else{
        cout << "Dw 亜寒帯冬季少雨気候区です" << endl;
    }
}
if (wea = "E"){
    if (maxtem < 0){
        cout << "EF 氷雪気候区です" << endl;
    }else{
        cout << "ET ツンドラ気候区です" << endl;
    }
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:10: error: redeclaration of 'double mintem'
   26 |   double mintem = *std::min_element(tem.begin(), tem.end());
      |          ^~~~~~
a.cc:23:8: note: 'double mintem' previously declared here
   23 | double mintem;
      |        ^~~~~~
a.cc:27:10: error: redeclaration of 'double maxtem'
   27 |   double maxtem = *std::max_element(tem.begin(), tem.end());
      |          ^~~~~~
a.cc:24:8: note: 'double maxtem' previously declared here
   24 | double maxtem;
      |        ^~~~~~
a.cc:32:8: error: redeclaration of 'double minpre'
   32 | double minpre = *min_element(pre.begin(), pre.end());
      |        ^~~~~~
a.cc:29:8: note: 'double minpre' previously declared here
   29 | double minpre;
      |        ^~~~~~
a.cc:33:8: error: redeclaration of 'double maxpre'
   33 | double maxpre = *max_element(pre.begin(), pre.end());
      |        ^~~~~~
a.cc:30:8: note: 'double maxpre' previously declared here
   30 | double maxpre;
      |        ^~~~~~
a.cc:74:9: error: could not convert 'wea.std::__cxx11::basic_string<char>::operator=(((const char*)"A"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   74 | if (wea = "A"){
      |     ~~~~^~~~~
      |         |
      |         std::__cxx11::basic_string<char>
a.cc:75:9: error: 'minpri' was not declared in this scope; did you mean 'minpre'?
   75 |     if (minpri >= 60){
      |         ^~~~~~
      |         minpre
a.cc:83:9: error: could not convert 'wea.std::__cxx11::basic_string<char>::operator=(((const char*)"B"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   83 | if (wea = "B"){
      |     ~~~~^~~~~
      |         |
      |         std::__cxx11::basic_string<char>
a.cc:90:9: error: could not convert 'wea.std::__cxx11::basic_string<char>::operator=(((const char*)"C"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   90 | if (wea = "C"){
      |     ~~~~^~~~~
      |         |
      |         std::__cxx11::basic_string<char>
a.cc:91:13: error: could not convert 'dry.std::__cxx11::basic_string<char>::operator=(((int)((char)((((const char*)"s") != 0) && (minpre < (double)30)))))' from 'std::__cxx11::basic_string<char>' to 'bool'
   91 |     if (dry = "s" && minpre < 30){
      |         ~~~~^~~~~~~~~~~~~~~~~~~~
      |             |
      |             std::__cxx11::basic_string<char>
a.cc:93:19: error: could not convert 'dry.std::__cxx11::basic_string<char>::operator=(((const char*)"w"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   93 |     }else if (dry = "w"){
      |               ~~~~^~~~~
      |                   |
      |                   std::__cxx11::basic_string<char>
a.cc:95:19: error: could not convert 'dry.std::__cxx11::basic_string<char>::operator=(((int)((char)((((const char*)"f") != 0) && (maxtem >= (double)22)))))' from 'std::__cxx11::basic_string<char>' to 'bool'
   95 |     }else if (dry = "f" && maxtem >= 22){
      |               ~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   std::__cxx11::basic_string<char>
a.cc:101:9: error: could not convert 'wea.std::__cxx11::basic_string<char>::operator=(((const char*)"D"))' from 'std::__cxx11::basic_string<char>' to 'bool'
  101 | if (wea = "D"){
      |     ~~~~^~~~~
      |         |
      |         std::__cxx11::basic_string<char>
a.cc:102:13: error: could not convert 'dry.std::__cxx11::basic_string<char>::operator=(((const char*)"f"))' from 'std::__cxx11::basic_string<char>' to 'bool'
  102 |     if (dry = "f"){
      |         ~~~~^~~~~
      |             |
      |             std::__cxx11::basic_string<char>
a.cc:108:9: error: could not convert 'wea.std::__cxx11::basic_string<char>::operator=(((const char*)"E"))' from 'std::__cxx11::basic_string<char>' to 'bool'
  108 | if (wea = "E"){
      |     ~~~~^~~~~
      |         |
      |         std::__cxx11::basic_string<char>