###### 循环-01~~~05

#include<iostream>
#include<iomanip>
int main()
{
using namespace std;
cout << fixed << right;
int a, b; int tot = 0;
cout << "ENter two integer between -100~100:\n";
if (cin >> a >> b)
{
for (int i = a; i < b + 1; i++)
{
tot += i;
cout << setw(5)<<i;
if ((i - a) % 5 == 4)
cout << endl;
}
}
cout << "\nTotal number =" << tot << endl;
return 0;
}

#include<iostream>
#include<cmath>
int main()
{
using namespace std;
int n = 0; double m = 1.0;
float sum = 1.0;
double lim;
cout << "Enter your expected limitation :\n";
cin >> lim;
while (m > lim)
{
n++;
m = m*n / (2 * n + 1);
sum += m;
}
cout.setf(ios_base::fixed,ios_base::floatfield);
cout.precision(6);
cout << "We get pi=" << 2 * sum << endl;
return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void show(const vector<int>&v,int );
int main()
{
int n; int result; int num = 0;
vector<int>line;
cout << "Enter a number no more than 6:";
cin >> n;
for (int i = n; i < n + 4; i++)
{
for (int j = n; j < n + 4;j++)
{
if (j != i)
{
for (int k = n; k < n + 4; k++)
{
if (k != i&&k != j)
{
result = 100 * i + 10 * j + 1 * k;
line.push_back(result);
num++;
}
}
}
}
}
cout << "We have total " << num << " scequence .\n";
sort(line.begin(), line.end());
show(line, 6);
return 0;
}
void show(const vector<int>&v, int n)
{
for (int i = 0; i < v.size(); i++)
{
if (i % n == (n-1))
cout << v[i] << endl;
else
cout << v[i]<<' ';
}
}

#include<iostream>
#include<cmath>
#include<cstdlib>
bool just(int n);
int main()
{
using std::cin; using std::cout; using std::endl;
cout << "Enter a double number:";
int num; cin >> num;
if (num % 2 != 0)
exit(EXIT_FAILURE);
for (int i = 3; i < num / 2; i = i + 2)
{
if (just(i) && just(num - i))
{
cout << "We have " << i << ',' << num - i <<" as expected."<< endl;
break;
}
}
return 0;
}
bool just(int n)
{
int count = 0;
for (int i = 2; i < n / 2; i++)
{
if (n%i == 0)
count++;
}
if (count == 0)
return true;
else
return false;
}

#include<iostream>
#include<cmath>
int power(int a, int b);
int main()
{
using namespace std;
long sum = 1;
int month=1; int lim;
cout << "Enter your expected numbeere:";
cin >> lim;
while (2 * sum < lim)
{
if (month>2&&month % 2 == 1)
{
int i = month / 2;
sum=power(2, i);
}
month++;
}
cout << "For the " << month-1 << "st month, rabits is enough.\n";
return 0;
}
int power(int a, int b)
{
int result = 1;
for (int i = 0; i < b; i++)
result *= a;
return result;
}

#### go时间格式化必须精确地限定到 golang 指定的时间原点：2006-01-02 15:04:05

2017-12-15 11:33:41

#### 在PC机上模拟对应的MODBUSRTU主机和从机,支持01,02,03,04,05,06,15,16命令,能对通信的质量,错误信息进行显示

2010年01月26日 166KB 下载

#### JAVA高并发学习笔记(三) JMM(Java内存模型)

2015-09-08 17:56:40

#### 一个ModBus RTU程序（支持01、02、03、05、06、15、16功能码）

2018-01-11 09:46:31

#### 6月1号装机遭遇坏硬盘：硬盘S.M.A.R.T技术损坏

2005-06-14 14:12:00

#### 关于case when复杂sql语句查询

2018-03-23 13:41:22

#### 基本编码规则（BER）介绍--SNMP

2010-02-06 21:55:00

#### [Java]2017.03.05

2017-03-05 16:42:13

#### 网盘搜索神器

2013年05月02日 772KB 下载

#### jsp网络编程——源文件（01——05）

2009年01月18日 3.28MB 下载