上一页 1 ··· 322 323 324 325 326 327 328 329 330 ··· 403 下一页
摘要: 求4行3列矩阵和3行4列矩阵的乘积。各构成元素的值从键盘输入。 1、 #include <stdio.h> int main(void) { int i, j, k, a[4][3], b[3][4], c[4][4] = {0}; puts("input the elements of 4 row 阅读全文
posted @ 2021-04-30 22:57 小鲨鱼2018 阅读(585) 评论(0) 推荐(1)
摘要: 1、 #include <stdio.h> #define NUMBER 1000 int main(void) { int i, j, num, a[NUMBER], b[11] = {0}; do { printf("num = "); scanf("%d", &num); if(num < 1 阅读全文
posted @ 2021-04-29 21:32 小鲨鱼2018 阅读(75) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #define NUMBER 1000 int main(void) { int i, j, num, a[NUMBER], b[11] = {0}; do { printf("num = "); scanf("%d", &num); if(num < 1 阅读全文
posted @ 2021-04-29 17:36 小鲨鱼2018 阅读(125) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #define NUMBER 1000 int main(void) { int i, num, a[NUMBER]; do { printf("number of element: "); scanf("%d", &num); if(num < 1 | 阅读全文
posted @ 2021-04-29 16:56 小鲨鱼2018 阅读(92) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #define NUMBER 4 int main(void) { int i, a[NUMBER]; printf("the number of elements: %d\n", NUMBER); for(i = 0; i < NUMBER; i++) 阅读全文
posted @ 2021-04-29 16:45 小鲨鱼2018 阅读(122) 评论(0) 推荐(0)
摘要: 在应用对象式宏的数组中对数组的元素进行倒序排列。 1、 #include <stdio.h> #define NUMBER 9 int main(void) { int i, a[NUMBER]; puts("please input the elements."); for(i = 0; i < 阅读全文
posted @ 2021-04-29 16:15 小鲨鱼2018 阅读(99) 评论(0) 推荐(0)
摘要: 将数组a的元素倒序复制到数组b中。 1、 #include <stdio.h> int main(void) { int i, a[7] = {3,2,8,4,2,9,1}, b[7]; for(i = 0; i < 7; i++) { b[i] = a[6 - i]; } for(i = 0; i 阅读全文
posted @ 2021-04-29 15:57 小鲨鱼2018 阅读(925) 评论(0) 推荐(0)
摘要: c语言中数组元素的个数。 虽然通过对象式宏修改数组元素个数非常的方便,但是每次都需要对程序进行修改,然后重新编译执行。因此,我们可以定义一个比较大的数组,然后从头开始仅使用其中需要的部分。 1、 #include <stdio.h> #define NUMBER 1000 int main(void 阅读全文
posted @ 2021-04-29 12:09 小鲨鱼2018 阅读(1352) 评论(0) 推荐(0)
摘要: 1、反转 永久反转 >>> test1 ['aa', 'bb', 'aa', 'cc', 'aa', 'cc', 'dd', 'xx', 'bb'] >>> test1.reverse() >>> test1 ['bb', 'xx', 'dd', 'cc', 'aa', 'cc', 'aa' 阅读全文
posted @ 2021-04-28 21:35 小鲨鱼2018 阅读(271) 评论(0) 推荐(0)
摘要: python中返回列表中指定元素的所有索引。 1、基本用法 >>> test1 ['aa', 'bb', 'aa', 'cc', 'aa', 'cc', 'dd', 'xx', 'bb'] >>> test1.index("aa") 0 2、返回所有索引 >>> test1 ['aa', 'bb', 阅读全文
posted @ 2021-04-28 21:22 小鲨鱼2018 阅读(3047) 评论(0) 推荐(0)
上一页 1 ··· 322 323 324 325 326 327 328 329 330 ··· 403 下一页