摘要: task 3 屏幕上分数是按从高到低排序的,同时生成了文本文件file3.dat。 task 4// 从文本数据文件file1.dat中读入数据,按成绩从高到低排序,并将排序结果输出到屏幕上,同时,也以二进制方式存入文件file4.dat中。 #include<stdio.h> #include < 阅读全文
posted @ 2020-12-28 20:18 wlemon 阅读(63) 评论(2) 推荐(0) 编辑
摘要: task 1 // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 阅读全文
posted @ 2020-12-21 19:32 wlemon 阅读(73) 评论(3) 推荐(0) 编辑
摘要: 任务1#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[ 阅读全文
posted @ 2020-12-16 15:11 wlemon 阅读(78) 评论(3) 推荐(0) 编辑
摘要: #include<stdio.h> #include<math.h> void solve(double a,double b,double c); int main() { double a,b,c; printf("Enter a,b,c:"); while(scanf("%lf%lf%lf", 阅读全文
posted @ 2020-12-06 20:05 wlemon 阅读(47) 评论(3) 推荐(0) 编辑
摘要: 实验任务四#include<stdio.h> #include<math.h> int main() { int n,a,b,i,s; printf("Enter a number:"); scanf("%d",&n); while(n){ i=0; s=0; while(n!=0){ a=n%10 阅读全文
posted @ 2020-11-18 23:40 wlemon 阅读(111) 评论(3) 推荐(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; }计算式为:d=5/7*100, e=5*10 阅读全文
posted @ 2020-11-05 22:50 wlemon 阅读(84) 评论(1) 推荐(0) 编辑
摘要: #include<stdio.h> int main(){ char ans1,ans2; printf("复习了没?(输入y或Y表示复习了,输入n或N表示没复习):"); ans1=getchar(); getchar(); printf("\n动手敲代码了没?(输入y或Y表示敲了,输入n或N表示 阅读全文
posted @ 2020-11-02 19:15 wlemon 阅读(80) 评论(1) 推荐(0) 编辑
摘要: #include<stdio.h> main() { printf("my stuno is:202083450014\n"); printf("2020 is a new year.新年新气象。2020,I am coming!\n"); } #include<stdio.h> int main( 阅读全文
posted @ 2020-10-18 12:41 wlemon 阅读(53) 评论(0) 推荐(0) 编辑
摘要: /*测试你是哪种学习者*/ #include<stdio.h> int main(){ int answer; int words[5000]; printf("在家上学让一些人欢喜一些人忧.\n"); printf("1.作为一个宅,社恐,觉得这样很好.有网络,自主学习,很ok.\n"); pri 阅读全文
posted @ 2020-10-18 12:25 wlemon 阅读(24) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main() {int x,y; int r1,r2,r3,r4; x=2; y=2; r1=x+y; r2=x-y; r3=x*y; r4=x/y; printf("r1 = %d\n",r1); printf("r2 = %d\n",r2); prin 阅读全文
posted @ 2020-10-18 12:23 wlemon 阅读(34) 评论(0) 推荐(0) 编辑