用C++设计一程序,输入三个整数,计算并输出这三个整数的和
用C++设计一程序,输入三个整数,计算并输出这三个整数的和
程序代码:
#include <iostream> using namespace std; int main() { int v1,v2,v3,sum; cout<<"Enter three int numbers:"<<endl; cin>>v1>>v2>>v3; sum=v1+v2+v3; cout<<"The sum of "<<v1<<" , "<<v2<<" and "<<v3<<" is:"<<sum<<endl; return 0; }