上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 84 下一页
摘要: 应用二维数组的知识 杨辉三角特点: 1.第一列和对角线的元素全部为1 2.其他元素等于上一行的当前列的值和上一行中当前列前边一列的值之和 #include<stdio.h> #define N 11 int main() { int a[N][N]={{0},{0,1}};/*初始化第0行和第一行, 阅读全文
posted @ 2019-12-13 07:49 木子欢儿 阅读(3746) 评论(0) 推荐(0)
摘要: #include<stdio.h> char* getword(char); char* getword(char c) { switch (c) { case'A':return"Apple"; case'B':return"Banana"; case'C':return"Cat"; case'D 阅读全文
posted @ 2019-12-13 07:27 木子欢儿 阅读(835) 评论(0) 推荐(0)
摘要: print("Hello,world!") if 5>2: print("5大于2") #这是一个注释 """这也是一个注释""" x = 5 y = "Hello, World!" print(x) print(y) x = 5 # x is of type int x = "Steve" # x 阅读全文
posted @ 2019-12-12 20:24 木子欢儿 阅读(145) 评论(0) 推荐(1)
摘要: 目的:用二维数组输出下面成绩 希望你可以成为第五名童鞋! 代码: #include<stdio.h> int main() { /* 创建一个带有 4行 5 列的数组 */ int a[4][5] = { {80,92,85,86,99}, {78,65,89,70,99}, {67,78,76,8 阅读全文
posted @ 2019-12-12 18:56 木子欢儿 阅读(2310) 评论(0) 推荐(0)
摘要: C 语言支持多维数组。多维数组声明的一般形式如下: type name[size1][size2]...[sizeN]; 二维数组 多维数组最简单的形式是二维数组。一个二维数组,在本质上,是一个一维数组的列表。声明一个 x 行 y 列的二维整型数组,形式如下: type arrayName [ x 阅读全文
posted @ 2019-12-12 18:31 木子欢儿 阅读(567) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include<string.h> int main() { char a[100]; int i,j,k,len; gets_s(a); len= strlen(a);/*计数器:遇到'\0'停止并返回计数器值*/ for(i=0;i<len/2;i++) 阅读全文
posted @ 2019-12-11 21:04 木子欢儿 阅读(1011) 评论(0) 推荐(0)
摘要: 分析:取余,判断个位是否相等,利用冒泡法排序 #include <stdio.h> int main() { int a[10] = { 11,22,33,44,15,20,17,30,10,23 };/*数组*/ int i, j, k; for(i=0;i<9;i++) for(j=0;j<9- 阅读全文
posted @ 2019-12-11 20:22 木子欢儿 阅读(697) 评论(0) 推荐(0)
摘要: 移动指针 #include<stdio.h> int main() { char *s="哈哈哈哈哈哈"; for(*s;s!="\0";s++) printf("%c",*s); } 这个s首先会指向第一个字符“哈”然后通过循环会一次打印出一个字符,s++是地址移动,打印了一个字符后,就会移动到下 阅读全文
posted @ 2019-12-11 08:08 木子欢儿 阅读(429) 评论(0) 推荐(0)
摘要: 内置函数 内置函数就是Python给你提供的, 拿来直接用的函数, 比如print., input等. 截止到python版本3.6.2 python一共提供了68个内置函数. #68个内置函数 # abs() dict() help() min() setattr() # all() dir() 阅读全文
posted @ 2019-12-09 17:06 木子欢儿 阅读(480) 评论(0) 推荐(0)
摘要: 仅供参考,个人习惯 阅读全文
posted @ 2019-12-09 16:20 木子欢儿 阅读(395) 评论(0) 推荐(0)
上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 84 下一页