摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 /*题目:输入某年某月某日,判断这一天是这一年的第几天*/ 4 int main() { 5 system("color 1F"); // 设定显示框为蓝底白字 6 system("mode con cols=80 lines=30"); //固定显示框尺寸 7 /************************ 阅读全文
posted @ 2019-08-23 17:35 狗狗王 阅读(4615) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 /*题目:一个整数,它加上100 后是一个完全平方数,再加上168 又是一个完全平方数,请问该数是多少?*/ 4 int main() { 5 system("color 1F"); // 设定显示框为蓝底白字 6 system("mode con cols=80 lines=30"); //固定显示框尺寸 7 阅读全文
posted @ 2019-08-23 17:34 狗狗王 阅读(1179) 评论(0) 推荐(0)
摘要: 1 #include 2 #include 3 /*企业发放的奖金根据利润提成。利润(I)低于或等于10 万元时,奖金可提10%;利润高于10 万元,低于20 万元 4 时,低于10 万元的部分按10%提成,高于10 万元的部分,可可提成7.5%; 20 万到40 万之间时,高于20 万元的部分, 5 可提成5%; 40 万到60 万之间时高于40 万元的部分,可提成3%;60 万到1... 阅读全文
posted @ 2019-08-23 17:33 狗狗王 阅读(5903) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 int main() //题目:有1、2、3、4 个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? 4 { 5 system("color 1F"); // 设定显示框为蓝底白字 6 system("mode con cols=80 lines=30"); //固定显示框尺寸 7 /********* 阅读全文
posted @ 2019-08-23 17:31 狗狗王 阅读(2310) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> /*题目:输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数*/ int main() { system("color 1F"); // 设定显示框为蓝底白字 system("mode con cols=80 lines=30"); //固定显示框尺寸 /**************************** 阅读全文
posted @ 2019-08-23 17:27 狗狗王 阅读(5292) 评论(0) 推荐(0)
摘要: 定义 关键字:struct struct 结构体名 { 结构体所包含的变量或数组}; //结尾为分号 struct stu{ char *name; //姓名 int num; //学号 int age; //年龄 char group; //所在学习小组 float score; //成绩 }; 阅读全文
posted @ 2019-08-23 17:24 狗狗王 阅读(1805) 评论(0) 推荐(0)
摘要: 一、指针指向变量:(一般指针) 下面有这样一个代码块: int main() {int a=10;int b=15;test(a,b);printf("a=%d,b=%d\n",a,b);} void test(int x,int y) {int tmp;tmp=x;x=y;y=tmp;} 最后输出 阅读全文
posted @ 2019-08-23 17:22 狗狗王 阅读(1706) 评论(0) 推荐(0)
摘要: 指针的基本概念和常见用法 * 为指针标识符。 如:*p 格式:datatype *name = value; //定义格式 int *p; //定义,定义时必须带* 。 float *p1 = &a; char *p2 = &c; p1 = &b; p2 = &d; //赋值,在定义的同时赋值需要带 阅读全文
posted @ 2019-08-23 17:21 狗狗王 阅读(1204) 评论(0) 推荐(0)
摘要: (1) 格式说明符中,可以指定数据的宽度,但不能指定数据的精度。例: 1 2 3 float a; scanf(“%10f”,&a); //正确 scanf(“%10.2f”,&a); //错误 float a; scanf(“%10f”,&a); //正确 scanf(“%10.2f”,&a);  阅读全文
posted @ 2019-08-23 17:19 狗狗王 阅读(585) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-08-23 17:15 狗狗王 阅读(107) 评论(0) 推荐(0)