2020年1月1日

实验7 文件

摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> const int N = 10; // 定义结构体类型struct student,并定义其别名为STU typedef struct student { long int id; 阅读全文

posted @ 2020-01-01 07:31 你微不微笑都很倾城 阅读(170) 评论(2) 推荐(0)

2019年12月24日

实验6 结构体、共用体与枚举

摘要: #include <stdio.h> #include <stdlib.h> const int N=5; // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; int score; 阅读全文

posted @ 2019-12-24 12:52 你微不微笑都很倾城 阅读(149) 评论(1) 推荐(0)

2019年12月17日

实验5 数组和指针

摘要: // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 i 阅读全文

posted @ 2019-12-17 23:30 你微不微笑都很倾城 阅读(126) 评论(1) 推荐(0)

2019年12月3日

实验四 函数和数组(1)

摘要: //寻找两个整数之间的所有素数(包括这两个整数),把结果保存在数组bb中,函数返回素数的个数。 // 例如,输入6和21,则输出为:7 11 13 17 19。 #include <stdio.h> #include <stdlib.h> #define N 1000 int fun(int n,i 阅读全文

posted @ 2019-12-03 21:30 你微不微笑都很倾城 阅读(119) 评论(1) 推荐(0)

2019年11月18日

实验3 循环语句

摘要: Part2 /* 编程找出5个整数的最大数和最小数 《C语言程序设计教程学习指导》p122实验内容(3) */ #include <stdio.h> #include <stdlib.h> int main() { int number, max, min, n; n=1; printf("输入第% 阅读全文

posted @ 2019-11-18 22:10 你微不微笑都很倾城 阅读(152) 评论(1) 推荐(0)

2019年11月6日

实验2 格式化输入输出和分支语句

摘要: Part1/* 《C语言程序设计教程学习指导》p118 实验内容(1) 这是一个常用格式控制符使用示例 运行程序,观察行结果,对照每一行printf()中的格式控制符,理解其功能和用法 */ #include <stdio.h> int main() { int x=1234; float f=12 阅读全文

posted @ 2019-11-06 00:00 你微不微笑都很倾城 阅读(243) 评论(3) 推荐(0)

2019年10月16日

实验1 C语言开发环境使用和数据类型、运算符、表达式

摘要: // 程序功能: // 要求用户从键盘输入一个整数,判断其是奇数还是偶数 #include <stdio.h> int main() { int x; printf("输入一个整数: \n"); scanf("%d",&x); // 在×××处填写相应表达式 // 使得当表达式成立时,判定x是奇数,否则是偶数 if( x%2==1) printf("%d是奇数",x); else printf(" 阅读全文

posted @ 2019-10-16 19:31 你微不微笑都很倾城 阅读(200) 评论(0) 推荐(0)

导航