摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> const int N = 10; // 定义结构体类型struct student,并定义其别名为STU typedef struct student { long int id; 阅读全文
posted @ 2019-12-26 21:54 烟雨陶 阅读(95) 评论(1) 推荐(0)
摘要: ex1.2#include <stdio.h> #include <stdlib.h> const int N=5; // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; int sc 阅读全文
posted @ 2019-12-19 14:16 烟雨陶 阅读(117) 评论(2) 推荐(1)
摘要: // 这个程序用于观察数组中的一组数据元素在内存中是否是连续存放的 // 以及数组元素的直接访问与间接访问 #include <stdio.h> #include <stdlib.h> const int N=3; int main() { int a[N] = {1, 2, 3}; // 定义一维 阅读全文
posted @ 2019-12-15 17:00 烟雨陶 阅读(95) 评论(2) 推荐(0)
摘要: 补足程序 #include <stdio.h> #include <stdlib.h> #define N 1000 int fun(int n,int m,int bb[N]) { int i,j,k=0,flag; for(j=n;j<=m;j++) { flag=1; for(i=2;i<j; 阅读全文
posted @ 2019-11-30 22:19 烟雨陶 阅读(118) 评论(1) 推荐(0)
摘要: part2,补足程序 /* 编程找出5个整数的最大数和最小数 《C语言程序设计教程学习指导》p122实验内容(3) */ #include <stdio.h> #include <stdlib.h> int main() { int number, max, min, n; n=1; printf( 阅读全文
posted @ 2019-11-17 23:58 烟雨陶 阅读(102) 评论(0) 推荐(0)
摘要: ex2.1 ex2.2 ex2.3 修改后的ex2.3 输出结果变不变 ex2.4 ex2.4修改后 将原来的choice=getchar();gai改为scanf(“%d",&choice;即可 运行结果不变 part3 ex2.5 ex2.6 es2.7 阅读全文
posted @ 2019-11-03 16:00 烟雨陶 阅读(79) 评论(2) 推荐(0)
摘要: #include <stdio.h> int main() { char ch; printf("please input:\n"); scanf("%c",&ch); // 根据程序功能描述,补足程序 if(ch>='a‘&&ch<=‘z'); // 如果ch是小写字母,补足判定ch是小写字母的表 阅读全文
posted @ 2019-10-23 23:10 烟雨陶 阅读(66) 评论(1) 推荐(0)
摘要: #include <stdio.h> int main() { int days; printf("输入一个整数: \n"); scanf("%d",&days); // 补足×××处的表达式,使得满足程序功能描述 if(days<=5) // days在1到5之间 printf("workdays 阅读全文
posted @ 2019-10-23 23:09 烟雨陶 阅读(83) 评论(1) 推荐(0)
摘要: #include <stdio.h> int main() { int x; printf("输入一个整数: \n"); scanf("%d",&x); // 在×××处填写相应表达式 // 使得当表达式成立时,判定x是奇数,否则是偶数 if( x%2==1) printf("是奇数"); else 阅读全文
posted @ 2019-10-23 23:08 烟雨陶 阅读(62) 评论(1) 推荐(0)