C++ 注释
程序的注释是解释性语句,您可以在 C++ 代码中包含注释,这将提高源代码的可读性。所有的编程语言都允许某种形式的注释。
C++ 支持单行注释和多行注释。注释中的所有字符会被 C++ 编译器忽略。
1 1 #include <iostream> 2 2 3 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 4 #include<cmath> 5 5 #include<iomanip> 6 6 using namespace std; 7 7 int main(int argc, char** argv) { 8 8 double a,b,c; 9 9 cout <<"plese enter a,b,c:"; 1010 cin >>a >>b >>c; 1111 if(a+b>c&&b+c>a&&c+a>b) 1212 { 1313 double s,area; 1414 s=(a+b+c)/2; 1515 area=sqrt(s*(s-a)*(s-b)*(s-c)); 1616 cout <<setiosflags(ios::fixed)<<setprecision(4); 1717 cout<<"area="<<area<<endl; 1818 } 1919 else cout <<"it is not a trilateral!"<<endl; 2020 return 0; 2121 }