高手帮我编一个C++多为数相加的编程吧

来源:百度知道 编辑:UC知道 时间:2024/05/17 09:52:55
完整的编程

#include <iostream>
using namespace std;

int main()
{
int a,b,c,d,sum,s;
cout <<"Enter the number A:"<<endl;
cin >>a;
cout <<"Enter the number B:"<<endl;
cin >>b;
cout <<"Enter the number C:"<<endl;
cin >>c;
cout <<"Enter the number D:"<<endl;
cin >>d;
sum=a+b+c+d;
s=a+(b-c)+d;
cout <<"The sum is:"<<sum <<endl
<<"The s is:" <<endl;
}

不知道这是不是你想要的?