摘要: 实验3 是,是,是 实验4 是,是,否 #include <stdio.h> #include <stdlib.h> #define N 10 typedef struct student { int num; char name[20]; int score; }STU; int main() { 阅读全文
posted @ 2021-01-01 15:00 愚人欢 阅读(36) 评论(3) 推荐(0) 编辑
摘要: #include <stdio.h> #include <string.h> #define N 3 //Task 1 typedef struct student { int id; char name[20]; char subject[20]; float perf; float mid; f 阅读全文
posted @ 2020-12-24 21:31 愚人欢 阅读(86) 评论(4) 推荐(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-18 18:26 愚人欢 阅读(46) 评论(4) 推荐(0) 编辑
摘要: 在任务一的程序中,一元二次方程的根无法设计成以函数数返回值的方式返回给主调函数。首先,教科书中提到“函数中允许有多个return语句,但每次只能有一个return语句被执行,即只能返回一个函数值”,这段话的意思就是我们可以通过条件语句出现多个return,但是函数的返回值只有一个,所有的return 阅读全文
posted @ 2020-12-07 15:49 愚人欢 阅读(66) 评论(2) 推荐(0) 编辑
摘要: #include <math.h> #include <stdio.h> int main() { float a, b, c, x1, x2; float delta, real, imag; printf("Enter a, b, c: "); while(scanf("%f%f%f", &a, 阅读全文
posted @ 2020-11-19 23:04 愚人欢 阅读(56) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main() { int a=5, b=7, c=100,d,e,f; d = a/b*c; e = a*c/b; f = c/b*a; printf("d=%d, e=%d, f=%d\n",d,e,f); return 0; } #include<st 阅读全文
posted @ 2020-11-05 14:29 愚人欢 阅读(69) 评论(2) 推荐(0) 编辑
摘要: #include <stdio.h> int main() { int answer; char words[5000]; printf("在家上学让一些人欢喜一些人忧.\n"); printf("1. 作为一个宅,社恐,觉得这样很好. 有网络,自主学习,很ok.\n"); printf("2. 不 阅读全文
posted @ 2020-10-16 21:30 愚人欢 阅读(21) 评论(1) 推荐(0) 编辑
摘要: #include <stdio.h> int main() { float x, y; // 定义两个整型变量,用来保存运算数据 float r1, r2, r3, r4; // 定义四个整型变量,用来保存加减乘除运算结果 x = 1; y = 2; r1 = x + y; r2 = x - y; 阅读全文
posted @ 2020-10-16 21:28 愚人欢 阅读(31) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main() { while(1) printf("老师最美"); return 0; } 阅读全文
posted @ 2020-10-16 21:25 愚人欢 阅读(40) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main() { int answer; char words[5000]; printf("在家上学让一些人欢喜一些人忧.\n"); printf("1. 作为一个宅,社恐,觉得这样很好. 有网络,自主学习,很ok.\n"); printf("2. 不 阅读全文
posted @ 2020-10-16 21:21 愚人欢 阅读(83) 评论(1) 推荐(0) 编辑