注意点:精度

#include<iostream>
using namespace std;
typedef long long ll;
int main() {
    int a,b;  
    ll cnt=0; 
    while(cin>>a>>b) {
        cnt=0;
        cnt=(1+a)*a*(1+b)*b/4;      //(1+a)*a*(1+b)*b/4 a,b都为整型  需要强制转化为ll 或将a,b定义为ll
        cout<<cnt<<endl;
    }
    return 0;
} 

 

相关文章:

  • 2022-12-23
  • 2021-10-18
  • 2021-12-03
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2022-02-14
  • 2021-05-01
猜你喜欢
  • 2021-12-22
  • 2021-10-11
  • 2021-08-05
  • 2021-11-12
  • 2021-07-22
  • 2022-02-24
  • 2021-08-06
相关资源
相似解决方案