C++程序设计:1.07
#include<iostream>
using namespace std;
int main()
{
cout<<4*(1.0-1.0/3+1.0/5-1.0/7+1.0/9-1.0/11)<<endl;
cout<<4*(1.0-1.0/3+1.0/5-1.0/7+1.0/9-1.0/11+1.0/13)<<endl;
return 0;
}
#include<iostream>
using namespace std;
int main()
{
cout<<4*(1.0-1.0/3+1.0/5-1.0/7+1.0/9-1.0/11)<<endl;
cout<<4*(1.0-1.0/3+1.0/5-1.0/7+1.0/9-1.0/11+1.0/13)<<endl;
return 0;
}
相关推荐