上一页 1 ··· 3 4 5 6 7
摘要: 第一个关键字:auto 用来声明自动变量。 可以显式的声明变量为自动变量。只要不是声明在所有函数之前的变量,即使没加auto关键字,也默认为自动变量。并且只在声明它的函数内有效。而且当使用完毕后,它的值会自动还原为最初所赋的值。自动变量使用时要先赋值,因为其中包含的是未知的值。例:auto int 阅读全文
posted @ 2019-08-23 17:14 狗狗王 阅读(1124) 评论(0) 推荐(0)
摘要: #include<stdio.h> int main() { int a,b; while(~scanf("%d%d", &a, &b)) //直接用语句作为循环条件 printf("%d\n",a+b); return 0; } 阅读全文
posted @ 2019-08-23 17:07 狗狗王 阅读(230) 评论(0) 推荐(0)
摘要: printf(“%[flag][width][.precision]typ”e); % 输出符 [flag] .precision 小数点位数 typ 数据类型 width 数据宽度 例如printf(“%-9.7d”e);表示输出e, 左对齐,总共占9个位置,不足的空格补齐,小数点精确到7位(不足 阅读全文
posted @ 2019-08-23 16:38 狗狗王 阅读(856) 评论(0) 推荐(0)
摘要: 生成一定范围内的随机数 在实际开发中,我们往往需要一定范围内的随机数,过大或者过小都不符合要求,那么,如何产生一定范围的随机数呢?我们可以利用取模的方法: 如果要规定上下限: 分析:取模即取余,rand()%51+13我们可以看成两部分:rand()%51是产生 0~50 的随机数,后面+13保证 阅读全文
posted @ 2019-08-23 16:26 狗狗王 阅读(17088) 评论(0) 推荐(0)
摘要: 1 #include 2 3 int main() 4 5 { 6 7 printf(" 摘苹果代码\n"); 8 9 int a[10],i,b=0,h,c; 10 11 printf("请分别输入小明的身高\n"); 12 13 scanf("%d",&h); 14 15 printf("请输入板凳的高度\n"); 16 17 scanf("%d",... 阅读全文
posted @ 2019-08-23 16:21 狗狗王 阅读(1961) 评论(0) 推荐(0)
摘要: 一 system("color a0"); //颜色函数 背景 字体 0 = 黑色 8 = 灰色 1 = 蓝色 9 = 淡蓝色 2 = 绿色 A = 淡绿色 3 = 湖蓝色 B = 淡浅绿色 4 = 红色 C = 淡红色 5 = 紫色 D = 淡紫色 6 = 黄色 E = 淡黄色 7 = 白色 F 阅读全文
posted @ 2019-08-23 16:11 狗狗王 阅读(1059) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <windows.h> 3 int main() 4 { 5 int a=0,b=1; 6 system("color 79"); 7 while(a<=1000) 8 { 9 b=0; 10 system("cls"); 11 while(b<=a) 12 { 13 printf(" "); 14 b=b+1; 15 } 16 Sl 阅读全文
posted @ 2019-08-23 16:05 狗狗王 阅读(324) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <windows.h> 3 int main() 4 { 5 system("mode con cols=50 lines=10"); 6 system("color 79"); 7 int a,b,c; 8 printf("请设定时(大于等于零的整数):"); 9 scanf("%d",&a); 10 printf("请设定分(大于 阅读全文
posted @ 2019-08-23 16:04 狗狗王 阅读(2451) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <windows.h> 3 int main() 4 { 5 system("mode con cols=30 lines=10"); //显示框大小控制函数 6 system("color 79"); //显示颜色控制函数,字体和背景 7 int a=0,b=0,c=0; 8 while(a>=0) 9 { 10 while(a<= 阅读全文
posted @ 2019-08-23 16:00 狗狗王 阅读(5409) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <dl> <dd> <table><tbody> <tr> <th width="70"> <p style="text-align: left;color: rgb(0, 0, 255);line-height:10px;font-size: 20px">小区名称:</p></th> <td width="150"<p style="font-size: 20p 阅读全文
posted @ 2019-08-23 15:58 狗狗王 阅读(741) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7