- 博客(3)
- 收藏
- 关注
原创 回文
判断输入的字符串是否为回文 #include #include #include using namespace std; int main() { int i, j, n; char s[100]; cin >> s; n = strlen(s); for (i = 0, j = n - 1; i <= n / 2; i++, j--) { if (s[i] != s[j])
2017-06-19 20:05:01
331
原创 复数类的运算
加法运算 1.通过函数实现两个复数的加法运算,同时输出符合手写规则。 #include using namespace std; class Complex { public: Complex(); void input(float a, float b); Complex add(Complex &c2); void display(); private: float real;
2017-06-01 21:12:02
589
原创 C语言排序算法
1.冒泡算法 #include using namespace std; int main() { int i, j, temp, a[5]; for (i = 0; i > a[i]; for (i = 0; i<5-1; i++) //n个数要进行n-1趟比较,为了简便,这里n=5 { for (j = 0; j<5-i-1; j++)
2017-05-26 23:22:05
151
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人