#include<iostream>
using namespace std;
int main()
{
int a,n,k;
int i,sum=0;
cin>>a;
cin>>n;
while(n<=0)
cin>>n;
for(i=a,k=1;k<=n;i++,k++)
{
sum+=i;
} cout<<sum<<endl;
return 0;
}
```
include [HTML_REMOVED]
using namespace std;
int main()
{
int a,n;
cin >> a;
while(cin >> n,n<=0); // 过滤0和负数
int res=0;
for(int i=0;i<n;i)
{
res +=a;
}
cout<<res;
}
```//第二中是大佬做法