函数名字与返回值类型在语义上不可冲突

函数名字与返回值类型在语义上不可冲突。

违反这条规则的典型代表是 C 标准库函数 getchar。

 1 #include <iostream>
 2 #include <stdlib.h>
 3 #include <math.h>
 4 #define PI 3.1415926535
 5 
 6 //main()函数的定义
 7 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 8 using namespace std;
 9 int main(int argc, char** argv) {
10     int i;
11     double d=180/PI;
12 
13     cout<<"X	ASIN(X)		ACOS(X)"<<endl;
14     cout<<"---------------------------------------"<<endl;
15     for (double x=0;x<=1.0+0.05;x=x+0.1) {
16         cout<<x<<"	";
17         cout<<int(asin(x)*d)<<"		";
18         cout<<int(acos(x)*d)<<endl;
19    }
20 }
原文地址:https://www.cnblogs.com/borter/p/9413575.html