12 2020 档案

摘要:实验任务三 1.是的 生成了 2.是的 正确且直观可读 实验任务四 1.输出了 生成了 是的 #include <stdio.h> #include <stdlib.h> #define N 10 typedef struct student { int num; char name[20]; in 阅读全文
posted @ 2020-12-31 11:15 陈政岩 阅读(53) 评论(2) 推荐(0)
摘要:#include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 运行程序输入测试时,可以把N改小一些输入测试 typedef struct student { int id; /*学生学号 */ char name[20] 阅读全文
posted @ 2020-12-21 23:28 陈政岩 阅读(62) 评论(2) 推荐(0)
摘要:#include <stdio.h> const int N=3; int main() { int a[N] = {1, 2, 3}; int i; printf("通过数组名及下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\n", &a[i] 阅读全文
posted @ 2020-12-16 23:23 陈政岩 阅读(75) 评论(2) 推荐(0)
摘要:任务一 不可以 因为return只可以返回一个值 并且函数中的变量是局部变量与主函数无关。 // 利用局部static变量计算阶乘 #include <stdio.h> long long fac(int n); // 函数声明 int main() { int i,n; printf("Enter 阅读全文
posted @ 2020-12-01 23:44 陈政岩 阅读(83) 评论(2) 推荐(0)