摘要:
源程序: #include < iostream > using namespace std; void print_triangle(char c, int n) { int i, j; for (i = 0; i< n; i++) { for (j = 0; j <= i; j++) { cou 阅读全文
posted @ 2019-11-19 11:23
bobo哥
阅读(1204)
评论(0)
推荐(0)
摘要:
源程序: #include < iostream.h > #include < math.h > double power(double a, int b) { int i; double result = 1.0; for(i=0;i< b;i++) result = result * a; re 阅读全文
posted @ 2019-11-19 11:15
bobo哥
阅读(773)
评论(2)
推荐(0)
摘要:
源程序: #include < iostream > using namespace std; char up(char c) { if (c >= 'a' && c <= 'z') return (c - 32); //大小写字母的ASCII相差32 else return c; } void m 阅读全文
posted @ 2019-11-19 10:56
bobo哥
阅读(795)
评论(0)
推荐(0)
摘要:
源程序: #include < iostream> #include < math.h > using namespace std; void equation_1(int a, int b, int c) { double x1, x2, temp; temp = b*b - 4 * a * c; 阅读全文
posted @ 2019-11-19 10:47
bobo哥
阅读(5044)
评论(0)
推荐(0)
摘要:
源程序: #include < iostream > #include < functional > #include < algorithm > #include < string > using namespace std; void main() { string str1("We are h 阅读全文
posted @ 2019-11-19 10:32
bobo哥
阅读(276)
评论(0)
推荐(0)
摘要:
源程序: 第一种方法: #include <iostream> #include <string> using namespace std; int main() { string str1="i am "; string str2="a teacher."; cout<<"连接前:"<<endl; 阅读全文
posted @ 2019-11-19 10:27
bobo哥
阅读(4324)
评论(0)
推荐(0)
摘要:
声明如下数组: int a[]={1,2,3,4,5,6,7,8}; 先查找4的位置,将数组a复制给数组b,然后将数组a的内容反转,再查找4的位置,最后分别输出数组a和b的内容。 源程序: #include < iostream> #include < algorithm> #include < f 阅读全文
posted @ 2019-11-19 09:59
bobo哥
阅读(247)
评论(0)
推荐(0)
摘要:
源程序: #include < iostream > #include < algorithm > //用于数组排列的头文件 #define N 5 using namespace std; void main() { float *p,sum=0; int i; p = new float[N]; 阅读全文
posted @ 2019-11-19 09:40
bobo哥
阅读(336)
评论(0)
推荐(0)
摘要:
#include <iostream> using namespace std; void main() { int *p,i; p = new int[100]; for (i = 0; i < 100; i++) { *(p + i) = i; //以指针的方式运行 cout << endl; 阅读全文
posted @ 2019-11-19 09:24
bobo哥
阅读(445)
评论(0)
推荐(0)
摘要:
源程序: #include <iostream> using namespace std; void main() { char a='A',b='B'; int ascii_1=53,ascii_2=54;//ASCII 码中的,5 和6 cout<<"字符输出:"<<(int)a<<","<<( 阅读全文
posted @ 2019-11-19 09:14
bobo哥
阅读(632)
评论(0)
推荐(0)

浙公网安备 33010602011771号