#include <iostream>using namespace std;
int main(){int d,a,n;while(cin>>d){for(int i=1;i<=49;i++){n=n+i*d;a=a+1+n;}cout<<a<<endl;}return 0;}
#include using namespace std;
int main(){int d,a,n;while(cin>>d){for(int i=1;i<=49;i++){n=n+i*d;<------------------n跟a沒有初始值,大致上,n跟a不會是0,a=a+1+n;<-----------------答案就會有所偏差。}cout<<a<<endl;}return 0;}
還有,你n跟a沒有歸零,會從上次的數字繼續往上加!