摘要: 实验三 给出了;生成;直观可读 实验四 输出了;直观可读 #include<stdio.h> #include<stdlib.h> #define N 10 typedef struct student { int num; char name[20]; int score; }STU; int m 阅读全文
posted @ 2021-01-01 14:51 海科龚天昊 阅读(52) 评论(2) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> #define N 4 typedef struct student { int id; char name[20]; char subject[20]; float perf; f 阅读全文
posted @ 2020-12-23 19:13 海科龚天昊 阅读(93) 评论(0) 推荐(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 08:57 海科龚天昊 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 一、 可以,可以return x1; return x2;再用printf函数进行输出: 二 #include <stdio.h> long long fac(int n); int main(){ int i,n; printf("Enter n:"); scanf("%d",&n); for(i 阅读全文
posted @ 2020-12-03 19:19 海科龚天昊 阅读(76) 评论(1) 推荐(0) 编辑
摘要: // 一元二次方程求解 // 重复执行, 直到按Ctrl+Z结束 // #include <math.h> #include <stdio.h> int main() { float a, b, c, x1, x2; float delta, real, imag; printf("Enter a, 阅读全文
posted @ 2020-11-15 17:16 海科龚天昊 阅读(146) 评论(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; } 分别为a乘b除c,a乘c除b,c除以b乘 阅读全文
posted @ 2020-11-02 13:08 海科龚天昊 阅读(86) 评论(0) 推荐(0) 编辑
摘要: /* A simple C program */ #include <stdio.h> int main() { printf("my stuno is:202083450030\n"); printf("2020,wish you\n"); return 0; } /*循环打印字符*/ #incl 阅读全文
posted @ 2020-10-17 15:05 海科龚天昊 阅读(106) 评论(0) 推荐(0) 编辑