摘要: 实验任务三 基于运行观察,回答实验任务3中的问题: 1.运行程序,观察在屏幕上是否正确输出了按分数由高→低排序的信息?同时,在当前路径下,是 否生成了文本文件file3.dat? 正确输出了按分数由高到低排序的信息。在当前路径下,生成了文本文件file3.dat 2.尝试用记事本程序打开文件file 阅读全文
posted @ 2020-12-31 13:51 新西兰小花猪 阅读(54) 评论(1) 推荐(0) 编辑
摘要: // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 typedef s 阅读全文
posted @ 2020-12-25 15:08 新西兰小花猪 阅读(63) 评论(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],a[i]); pr 阅读全文
posted @ 2020-12-17 11:44 新西兰小花猪 阅读(89) 评论(1) 推荐(0) 编辑
摘要: #include<stdio.h> int func(int, int); int main() { int k=4,m=1,p1,p2; p1=func(k,m) ; p2 = func(k,m) ; printf("%d,%d\n",p1,p2); return 0;} int func(int 阅读全文
posted @ 2020-12-04 18:11 新西兰小花猪 阅读(93) 评论(0) 推荐(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,&b,&c)!=EOF 阅读全文
posted @ 2020-11-19 23:23 新西兰小花猪 阅读(64) 评论(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; } lin6: 5/7=0,0*100 阅读全文
posted @ 2020-10-31 10:31 新西兰小花猪 阅读(175) 评论(1) 推荐(0) 编辑
摘要: #include<stdio.h> int main(){ printf("my stuno is:202083450042\n"); printf("2020,like u\n"); return 0; } #include<stdio.h> int main(){ while (1) print 阅读全文
posted @ 2020-10-17 14:33 新西兰小花猪 阅读(74) 评论(0) 推荐(0) 编辑