2025年柯本气候分类法的 C++实现

柯本气候分类法的 C++实现include bits stdc h using namespace std int main cout lt lt 请依次输入 MAP MAT Thot Tcold Tmon10 Pdry Psdry Pwdry Pswet Pwwet Pthreshold lt bits

大家好,我是讯享网,很高兴认识大家。
#include<bits/stdc++.h> using namespace std; int main() { 
    cout << "请依次输入MAP, MAT, Thot, Tcold, Tmon10, Pdry, Psdry, Pwdry, Pswet, Pwwet, Pthreshold:" << endl; double MAP, MAT, Thot, Tcold, Tmon10, Pdry, Psdry, Pwdry, Pswet, Pwwet, Pthreshold; cin >> MAP >> MAT >> Thot >> Tcold >> Tmon10 >> Pdry >> Psdry >> Pwdry >> Pswet >> Pwwet >> Pthreshold; if (MAP < 10 * Pthreshold) { 
    //先判断是不是干带 if (MAP < 5 * Pthreshold) { 
    if (MAT >= 18) { 
    cout << "BWh"; } else { 
    cout << "BWk"; } } else { 
    if (MAT >= 18) { 
    cout << "BSh"; } else { 
    cout << "BSk"; } } } else if (Tcold >= 18) { 
    if (Pdry >= 60) { 
    cout << "Af"; } else if (Pdry >= 100 - MAP / 25) { 
    cout << "Am"; } else { 
    cout << "Aw"; } } else if (Thot > 10 && Tcold > 0 && Tcold < 18) { 
    if (Psdry < 40 && Psdry < Pwwet / 3 && Pwdry < Pswet / 10) { 
    double summer_precipitation, winter_precipitation; cout << "请输入夏半年降水量:" << endl; cin >> summer_precipitation; cout << "请输入冬半年降水量:" << endl; cin >> winter_precipitation; if (summer_precipitation > winter_precipitation) { 
    if (Thot >= 22) { 
    cout << "Cwa"; } else if (Tmon10 >= 4) { 
    cout << "Cwb"; } else if (Tmon10 >= 1 && Tmon10 < 4) { 
    cout << "Cwc"; } } else { 
    if (Thot >= 22) { 
    cout << "Csa"; } else if (Tmon10 >= 4) { 
    cout << "Csb"; } else if (Tmon10 >= 1 && Tmon10 < 4) { 
    cout << "Csc"; } } } else if (Psdry < 40 && Psdry < Pwwet / 3) { 
    if (Thot >= 22) { 
    cout << "Csa"; } else if (Tmon10 >= 4) { 
    cout << "Csb"; } else if (Tmon10 >= 1 && Tmon10 < 4) { 
    cout << "Csc"; } } else if (Pwdry < Pswet / 10) { 
    if (Thot >= 22) { 
    cout << "Cwa"; } else if (Tmon10 >= 4) { 
    cout << "Cwb"; } else if (Tmon10 >= 1 && Tmon10 < 4) { 
    cout << "Cwc"; } } else { 
    if (Thot >= 22) { 
    cout << "Cfa"; } else if (Tmon10 >= 4) { 
    cout << "Cfb"; } else if(Tmon10 >= 1 && Tmon10 < 4) { 
    cout << "Cfc"; } } } else if (Thot > 10 && Tcold <= 0) { 
    if (Psdry < 40 && Psdry < Pwwet / 3 && Pwdry < Pswet / 10) { 
    double summer_precipitation, winter_precipitation; cout << "请输入夏半年降水量:" << endl; cin >> summer_precipitation; cout << "请输入冬半年降水量:" << endl; cin >> winter_precipitation; if (summer_precipitation > winter_precipitation) { 
    if (Thot >= 22) { 
    cout << "Dwa"; } else if (Tmon10 >= 4) { 
    cout << "Dwb"; } else if (Tcold < -38) { 
    cout << "Dwd"; } else { 
    cout << "Dwc"; } } else { 
    if (Thot >= 22) { 
    cout << "Dsa"; } else if (Tmon10 >= 4) { 
    cout << "Dsb"; } else if (Tcold < -38) { 
    cout << "Dsd"; } else { 
    cout << "Dsc"; } } } else if (Psdry < 40 && Psdry < Pwwet / 3) { 
    if (Thot >= 22) { 
    cout << "Dsa"; } else if (Tmon10 >= 4) { 
    cout << "Dsb"; } else if (Tcold < -38) { 
    cout << "Dsd"; } else { 
    cout << "Dsc"; } } else if (Pwdry < Pswet / 10) { 
    if (Thot >= 22) { 
    cout << "Dwa"; } else if (Tmon10 >= 4) { 
    cout << "Dwb"; } else if (Tcold < -38) { 
    cout << "Dwd"; } else { 
    cout << "Dwc"; } } else { 
    if (Thot >= 22) { 
    cout << "Dfa"; } else if (Tmon10 >= 4) { 
    cout << "Dfb"; } else if (Tcold < -38) { 
    cout << "Dfd"; } else { 
    cout << "Dfc"; } } } else if (Thot < 10) { 
    if (Thot > 0) { 
    cout << "ET"; } else if (Thot <= 0) { 
    cout << "EF"; } } } 

讯享网
小讯
上一篇 2025-03-05 10:33
下一篇 2025-02-18 18:18

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/84802.html