计算并显示

 1 #include <iostream>
 2 
 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 4 using namespace std;
 5 int main(int argc, char** argv) {
 6     
 7     double s1,s2,s3;
 8     s1=1.5;    /* 对变量s1赋值*/
 9     cout<<"s1="<<s1<<endl;
10     /* 对变量s2赋值*/    s2=2.5;
11     cout<<"s2="<<s2<<endl;
12     s3=  /* 对变量s3赋值*/  3.5;
13     cout<<"s3="<<s3<<endl;
14 
15     cout<<"s1+s2+s3="<<s1+s2+s3<<endl;        //计算并显示
16     //计算并显示 cout<<"s1+s2+s3="<<s1+s2+s3<<endl; 
17     return 0;
18 }
原文地址:https://www.cnblogs.com/borter/p/9405607.html