MOOC哈工大2020C语言程序设计精髓练兵区编程题第十二周

本文主要是介绍MOOC哈工大2020C语言程序设计精髓练兵区编程题第十二周,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1 大奖赛现场统分(4分)

题目内容:

已知某大奖赛有n个选手参赛,m(m>2)个评委为参赛选手评分(最高10分,最低0分)。统分规则为:在每个选手的m个得分中,去掉一个最高分和一个最低分后,取平均分作为该选手的最后得分。要求编程实现:

(1)根据n个选手的最后得分,从高到低输出选手的得分名次表,以确定获奖名单;

(2)根据各选手的最后得分与各评委给该选手所评分数的差距,对每个评委评分的准确性和评分水准给出一个定量的评价,从高到低输出各评委得分的名次表。

提示:首先设计如下5个数组:

(1)sh[i],存放第i个选手的编号;

(2)sf[i],存放第i个选手的最后得分,即去掉一个最高分和一个最低分以后的平均分;

(3)ph[j],存放第j个评委的编号;

(4)f[i][j],存放第j个评委给第i个选手的评分;

(5)pf[j],存放代表第j个评委评分水准的得分。

解决本问题的关键在于计算选手的最后得分和评委的得分。

先计算选手的最后得分。外层循环控制参赛选手的编号i从1变化到n,当第i个选手上场时,输入该选手的编号sh[i]。内层循环控制给选手评分的评委的编号j从1变化到m,依次输入第j个评委给第i个选手的评分f[i][j],并将其累加到sf[i]中,同时求出最高分max和最低分min。当第i个选手的m个得分全部输入并累加完毕后,去掉一个最高分max,去掉一个最低分min,于是第i个选手的最后得分为:

sf[i] = (sf[i] – max – min)/(m-2);

当n个参赛选手的最后得分sf[0],sf[1],…,sf[n]全部计算完毕后,再将其从高到低排序,打印参赛选手的名次表。

下面计算评委的得分。评委给选手评分存在误差,即f[i][j]≠sf[i]是正常的,也是允许的。但如果某个评委给每个选手的评分与各选手的最后得分都相差太大,则说明该评委的评分有失水准。可用下面的公式来对各个评委的评分水平进行定量评价:

#define N 10//找最大值,返回索引
int FindMax(float scores[], int n);//找最小值,返回索引
int FindMin(float scores[], int n);//计算最终分数
float CalculationFinalScore(float scores[], int n, int maxIndex, int minIndex);//选手排序
void OrderAthletes(float sf[], int sh[], int n);//评委排序
void OrderJudges(float f[][N], float sf[], float pf[], int ph[], int n, int m);int main()
{int n, m, maxIndex, minIndex, sh[N], ph[N];float aver, scores[N], sf[N], pf[N], f[N][N], avers[N];printf("How many Athletes?\n");scanf("%d", &n);printf("How many judges?\n");scanf("%d", &m);printf("Scores of Athletes:\n");for (int k = 0; k < m; ++k){ph[k] = k + 1;}//多少位选手for (int i = 0; i < n; i++){printf("Athlete %d is playing.\n", i + 1);printf("Please enter his number code:\n");scanf("%d", &sh[i]);//评委for (int j = 0; j < m; ++j){printf("Judge %d gives score:\n", j + 1);scanf("%f", &f[i][j]);scores[j] = f[i][j];}maxIndex = FindMax(scores, m);minIndex = FindMin(scores, m);printf("Delete a maximum score:%.1f\n", scores[maxIndex]);printf("Delete a minimum score:%.1f\n", scores[minIndex]);aver = CalculationFinalScore(scores, m, maxIndex, minIndex);printf("The final score of Athlete %d is %.3f\n", sh[i], aver);//平均分放进数组sf[i] = aver;avers[i] = aver;}printf("Order of Athletes:\n");OrderAthletes(sf, sh, n);printf("Order of judges:\n");OrderJudges(f, avers, pf, ph, n, m);printf("Over!Thank you!\n");
}int FindMax(float scores[], int n)
{int max = 0;for (int i = 1; i < n; ++i){if (scores[max] < scores[i]){max = i;}}return max;
}int FindMin(float scores[], int n)
{int min = 0;for (int i = 1; i < n; ++i){if (scores[min] > scores[i]){min = i;}}return min;
}float CalculationFinalScore(float scores[], int n, int maxIndex, int minIndex)
{float sum = 0;for (int i = 0; i < n; ++i){if (i == maxIndex || i == minIndex){continue;}sum += scores[i];}return sum / (n - 2);
}void OrderAthletes(float sf[], int sh[], int n)
{float temp;int flag, t;for (int i = 0; i < n; ++i){flag = 0;for (int j = 0; j < n - i - 1; ++j){if (sf[j] < sf[j + 1]){temp = sf[j + 1];sf[j + 1] = sf[j];sf[j] = temp;t = sh[j + 1];sh[j + 1] = sh[j];sh[j] = t;flag = 1;}}if (!flag){break;}}printf("order\tfinal score\tnumber code\n");for (int k = 0; k < n; ++k){printf("%5d\t%11.3f\t%6d\n", k + 1, sf[k], sh[k]);}
}void OrderJudges(float f[][N], float sf[], float pf[], int ph[], int n, int m)
{int i, j, term1;float sum, term2;for (i = 0; i < m; i++){sum = 0;for (j = 0; j < n; j++){sum = sum + (f[j][i] - sf[j]) * (f[j][i] - sf[j]);}sum = sum / (float) n;pf[i] = 10 - sqrt(sum);}for (j = 0; j < n; j++){for (i = 0; i < m - 1; i++){if (pf[i] < pf[i + 1]){term1 = ph[i];ph[i] = ph[i + 1];ph[i + 1] = term1;term2 = pf[i];pf[i] = pf[i + 1];pf[i + 1] = term2;}}}printf("order\tfinal score\tnumber code\n");for (i = 0; i < m; i++){printf("%5d\t%11.3f\t%6d\n", i + 1, pf[i], ph[i]);}
}

2 学生成绩管理系统V3.0(4分)

题目内容:

某班有最多不超过30人(具体人数由键盘输入)参加某门课程的考试,参考第11周在线测验中“学生成绩管理系统V2.0”,用二维字符数组作函数参数编程实现如下菜单驱动的学生成绩管理系统:

(1)录入每个学生的学号、姓名和考试成绩;

(2)计算课程的总分和平均分;

(3)按成绩由高到低排出名次表;

(4)按成绩由低到高排出名次表;

(5)按学号由小到大排出成绩表;

(6)按姓名的字典顺序排出成绩表;

(7)按学号查询学生排名及其考试成绩;

(8)按姓名查询学生排名及其考试成绩;

(9)按优秀(90~100)、良好(80~89)、中等(70~79)、及格(60~69)、不及格(0~59)5个类别,统计每个类别的人数以及所占的百分比;

(10)输出每个学生的学号、姓名、考试成绩。

要求程序运行后先显示如下菜单,并提示用户输入选项:

1.Input record

2.Caculate total and average score of course

3.Sort in descending order by score

4.Sort in ascending order by score

5.Sort in ascending order by number

6.Sort in dictionary order by name

7.Search by number

8.Search by name

9.Statistic analysis

10.List record

0.Exit

Please enter your choice:

然后,根据用户输入的选项执行相应的操作。

请按照下面的定义及函数原型编程

#define   MAX_LEN  10         /* 字符串最大长度 */

#define   STU_NUM 30         /* 最多的学生人数 */

int   Menu(void);

void  ReadScore(long num[], char name[][MAX_LEN], float score[], int n);

void  AverSumofScore(float score[], int n);

void  SortbyScore(long num[], char name[][MAX_LEN], float score[], int n,

int (*compare)(float a, float b));

int   Ascending(float a, float b);

int   Descending(float a, float b);

void  SwapFloat(float *x, float *y);

void  SwapLong(long *x, long *y);

void  SwapChar(char x[], char y[]);

void  AsSortbyNum(long num[], char name[][MAX_LEN], float score[], int n);

void  SortbyName(long num[], char name[][MAX_LEN], float score[], int n);

void  SearchbyNum(long num[], char name[][MAX_LEN], float score[], int n);

void  SearchbyName(long num[], char name[][MAX_LEN], float score[], int n);

void  StatisticAnalysis(float score[], int n);

void  PrintScore(long num[], char name[][MAX_LEN], float score[], int n) ;

#include <string.h>
// 字符串最大长度
#define   MAX_LEN  10
// 最多的学生人数
#define   STU_NUM 30int Menu(void);void ReadScore(long num[], char name[][MAX_LEN], float score[], int n);void AverSumofScore(float score[], int n);void SortbyScore(long num[], char name[][MAX_LEN], float score[], int n, int (*compare)(float a, float b));int Ascending(float a, float b);int Descending(float a, float b);void SwapFloat(float *x, float *y);void SwapLong(long *x, long *y);void SwapChar(char x[], char y[]);void AsSortbyNum(long num[], char name[][MAX_LEN], float score[], int n);void SortbyName(long num[], char name[][MAX_LEN], float score[], int n);void SearchbyNum(long num[], char name[][MAX_LEN], float score[], int n);void SearchbyName(long num[], char name[][MAX_LEN], float score[], int n);void StatisticAnalysis(float score[], int n);void PrintScore(long num[], char name[][MAX_LEN], float score[], int n);int main()
{int n, m;long num[STU_NUM];float scores[STU_NUM];char name[STU_NUM][MAX_LEN];printf("Input student number(n<30):\n");scanf("%d", &n);Menu();while (scanf("%d", &m) && m != 0){switch (m){case 1:ReadScore(num, name, scores, n);break;case 2:AverSumofScore(scores, n);break;case 3:printf("Sort in descending order by score:\n");SortbyScore(num, name, scores, n, Descending);break;case 4:printf("Sort in ascending order by score:\n");SortbyScore(num, name, scores, n, Ascending);break;case 5:printf("Sort in ascending order by number:\n");AsSortbyNum(num, name, scores, n);break;case 6:printf("Sort in dictionary order by name:\n");SortbyName(num, name, scores, n);break;case 7:SearchbyNum(num, name, scores, n);break;case 8:SearchbyName(num, name, scores, n);break;case 9:StatisticAnalysis(scores, n);break;case 10:PrintScore(num, name, scores, n);break;default:printf("Input error!\n");}Menu();}printf("End of program!\n");return 0;
}int Menu(void)
{printf("Management for Students' scores\n""1.Input record\n""2.Caculate total and average score of course\n""3.Sort in descending order by score\n""4.Sort in ascending order by score\n""5.Sort in ascending order by number\n""6.Sort in dictionary order by name\n""7.Search by number\n""8.Search by name\n""9.Statistic analysis\n""10.List record\n""0.Exit\n""Please Input your choice:\n");return 0;
}void ReadScore(long num[], char name[][MAX_LEN], float score[], int n)
{printf("Input student's ID, name and score:\n");for (int i = 0; i < n; ++i){scanf("%ld%s%f", &num[i], name[i], &score[i]);}
}void AverSumofScore(float score[], int n)
{float sum = 0;for (int i = 0; i < n; ++i){sum += score[i];}printf("sum=%.0f,aver=%.2f\n", sum, sum / n);
}void SortbyScore(long num[], char name[][MAX_LEN], float score[], int n, int (*compare)(float a, float b))
{int flag;for (int i = 0; i < n; ++i){flag = 0;for (int j = 0; j < n - i - 1; ++j){if((*compare)(score[j], score[j + 1])){SwapFloat(&score[j], &score[j + 1]);SwapLong(&num[j], &num[j + 1]);SwapChar(name[j], name[j + 1]);flag = 1;}}if(!flag){break;}}PrintScore(num, name, score, n);
}int  Ascending(float a, float b)
{return a > b ? 1 : 0;
}int Descending(float a, float b)
{return a < b ? 1 : 0;
}void SwapFloat(float *x, float *y)
{float temp;temp = *x;*x = *y;*y = temp;
}void SwapLong(long *x, long *y)
{long temp;temp = *x;*x = *y;*y = temp;
}void SwapChar(char x[], char y[])
{char temp[MAX_LEN];strcpy(temp, x);strcpy(x, y);strcpy(y, temp);
}void AsSortbyNum(long num[], char name[][MAX_LEN], float score[], int n)
{int flag;for (int i = 0; i < n; ++i){flag = 0;for (int j = 0; j < n - i - 1; ++j){if(num[j] > num[j + 1]){SwapLong(&num[j], &num[j + 1]);SwapFloat(&score[j], &score[j + 1]);SwapChar(name[j], name[j + 1]);flag = 1;}}if(!flag){break;}}PrintScore(num, name, score, n);
}void SortbyName(long num[], char name[][MAX_LEN], float score[], int n)
{int flag;for (int i = 0; i < n; ++i){flag = 0;for (int j = 0; j < n - i - 1; ++j){if(strcmp(name[j], name[j + 1]) > 0){SwapLong(&num[j], &num[j + 1]);SwapFloat(&score[j], &score[j + 1]);SwapChar(name[j], name[j + 1]);flag = 1;}}if(!flag){break;}}PrintScore(num, name, score, n);
}void SearchbyNum(long num[], char name[][MAX_LEN], float score[], int n)
{long number;int flag = 0, i;printf("Input the number you want to search:\n");scanf("%ld", &number);for (i = 0; i < n; ++i){if(number == num[i]){flag = 1;break;}}if(flag){printf("%ld\t%s\t%.0f\n", num[i], name[i], score[i]);}else{printf("Not found!\n");}}void SearchbyName(long num[], char name[][MAX_LEN], float score[], int n)
{char str[MAX_LEN];int i, flag = 0;printf("Input the name you want to search:\n");scanf("%s", str);for (i = 0; i < n; ++i){if(strcmp(name[i], str) == 0){flag = 1;break;}}if(flag){printf("%ld\t%s\t%.0f\n", num[i], name[i], score[i]);}else{printf("Not found!\n");}
}void StatisticAnalysis(float scores[], int n)
{int a, b, c, d, e, f;a = b = c = d = e = f = 0;float score;for (int i = 0; i < n; ++i){score = scores[i];if(score == 100){a++;}else if(score >= 90 && score < 100 ){b++;}else if(score >= 80){c++;}else if(score >= 70){d++;}else if(score >= 60){e++;}else{f++;}}printf("<60\t%d\t%.2f%%\n", f, (float)(100 * f) / n);printf("%d-%d\t%d\t%.2f%%\n" , 60, 69, e, (float)(100 * e) / n);printf("%d-%d\t%d\t%.2f%%\n" , 70, 79, d, (float)(100 * d) / n);printf("%d-%d\t%d\t%.2f%%\n" , 80, 89, c, (float)(100 * c) / n);printf("%d-%d\t%d\t%.2f%%\n" , 90, 99, b, (float)(100 * b) / n);printf("%d\t%d\t%.2f%%\n", 100, a,(float)(100 * a) / n);
}void PrintScore(long num[], char name[][MAX_LEN], float score[], int n)
{for (int k = 0; k < n; ++k){printf("%ld\t%s\t%.0f\n", num[k], name[k], score[k]);}
}

3 单词接龙(4分)

题目内容:

阿泰和女友小菲用英语短信玩单词接龙游戏。一人先写一个英文单词,然后另一个人回复一个英文单词,要求回复单词的开头有若干个字母和上一个人所写单词的结尾若干个字母相同,重合部分的长度不限。(如阿泰输入happy,小菲可以回复python,重合部分为py。)现在,小菲刚刚回复了阿泰一个单词,阿泰想知道这个单词与自己发过去的单词的重合部分是什么。他们两人都是喜欢写长单词的英语大神,阿泰觉得用肉眼找重合部分实在是太难了,所以请你编写程序来帮他找出重合部分。

#define STR_LEN 80int main()
{char word[STR_LEN + 1], word2[STR_LEN + 1], word3[STR_LEN + 1];int i = 0, j = 0, k = 0;scanf("%s%s", word, word2);while (word[i] != '\0'){if(word[i] == word2[0]){while (word2[j] != '\0'){if(word[i + j] != word2[j]){break;}else{word3[k] = word2[j];k++;}j++;}word3[k] = '\0';}i++;}printf("%s\n", word3);return 0;
}

4 分数比较(4分)

题目内容:

比较两个分数的大小。人工方式下比较分数大小最常见的方法是:进行分数的通分后比较分子的大小。可以编程模拟手工解决。

具体要求为首先输出("Input two FENSHU:\n"),然后输入两个分数分子分母的值,格式为("%d/%d,%d/%d"),判断完成后输出("%d/%d<%d/%d\n")或("%d/%d>%d/%d\n")或("%d/%d=%d/%d\n");

int main()
{int a, b, c, d;printf("Input two FENSHU:\n");scanf("%d/%d,%d/%d", &a, &b, &c, &d);if(a * d > b * c){printf("%d/%d>%d/%d\n", a, b, c, d);}else if(a * d == b * c){printf("%d/%d=%d/%d\n", a, b, c, d);}else{printf("%d/%d<%d/%d\n", a, b, c, d);}return 0;
}

5 百万富翁的换钱计划(4分)

题目内容:

有一天,一位百万富翁遇到一个陌生人,陌生人找他谈一个换钱的计划,陌生人对百万富翁说:“我每天给你10万元,而你第一天只需给我1分钱,第二天我仍给你10万元,你给我2分钱,第三天我仍给你10万元,你给我4分钱……。你每天给我的钱是前一天的两倍,直到满一个月(30天)为止”,百万富翁很高兴,欣然接受了这个契约。请编程计算在这一个月中陌生人总计给百万富翁多少钱,百万富翁总计给陌生人多少钱。程序中浮点数的数据类型均为double。

int main()
{double stranger = 0, richMan = 0;for (int i = 1; i <= 30; ++i){richMan += 100000;stranger += pow(2, i - 1) * 0.01;}printf("to Stranger: %.2f yuan\n", stranger);printf("to Richman: %.2f yuan\n", richMan);return 0;
}

6 用计数控制的循环实现正数累加求和(4分)

题目内容:

输入一些整数,编程计算并输出其中所有正数的和,输入负数时不累加,继续输入下一个数。输入零时,表示输入数据结束。要求最后统计出累加的项数。

int main()
{int count = 0, sum = 0, n;do{printf("Input a number:\n");scanf("%d", &n);if(n < 0){continue;}sum += n;count++;}while (n != 0);printf("sum=%d,count=%d\n", sum, count - 1);return 0;
}

7 平方根表(4分)

题目内容:

输出100(n^2<=100)以内整数的平方根表,n的值要求从键盘输入,并且满足n^2<=100 (即n的平方值在100以内)。

int main()
{int n;printf("Input n(n<=10):\n");scanf("%d", &n);if(n <= 10){for (int i = 0; i < n; ++i){printf("%7d", i);}printf("\n");for (int i = 0; i < n; ++i){printf("%d", i);for (int j = 0; j < n; ++j){printf("%7.3f", sqrt(i * 10 + j));}printf("\n");}}return 0;
}

8 最大公约数(4分)

题目内容:

按照如下函数原型编写子函数计算正整数a和b的所有公约数。第一次调用,返回最大公约数。以后只要再使用相同参数调用,每次返回下一个小一些的公约数。无公约数时,函数CommonFactors()返回-1,主函数中不输出任何信息。

函数原型: int CommonFactors(int a, int b)

int CommonFactors(int a, int b);int n=1;
int main()
{int a, b, result, i;printf("Input a and b:\n");scanf("%d,%d", &a, &b);result = CommonFactors(a, b);if(a>0 && b>0){for(i=1;result != -1;i++){n++;printf("Common factor %d is %d\n", i, result);result = CommonFactors(a, b);}}return 0;
}int CommonFactors(int a, int b)
{int i, count = 0;for (i = a; i >= 1; i--){if (a % i == 0 && b % i == 0){count++;}if (n == count)return i;}return -1;
}

9 23根火柴游戏(4分)

题目内容:

请编写一个简单的23 根火柴游戏程序,实现人跟计算机玩这个游戏的程序。为了方便程序自动评测,假设计算机移动的火柴数不是随机的,而是将剩余的火柴根数对3求余后再加1来作为计算机每次取走的火柴数。如果剩余的火柴数小于3,则将剩余的火柴数减1作为计算机移走的火柴数。但是计算机不可以不取,剩下的火柴数为1时,必须取走1根火柴。假设游戏规则如下:

1)游戏者开始拥有23根火柴棒;

2)每个游戏者轮流移走1 根、2 根或3 根火柴;

3)谁取走最后一根火柴为失败者。

int main()
{int n, m, sum = 23;printf("Game start!\n""Note: the maximum number is 3\n");while (1){printf("Please enter the number of matches you are moving:\n");scanf("%d", &n);if (n < 0 || n > 3){printf("The number you entered is wrong,please re-enter!\n");continue;}else{printf("The number of matches you are moving is:%d\n", n);sum = sum - n;printf("The number of matches left is:%d\n", sum);if (sum == 0){printf("I'm sorry. You lost!\n");break;}if (sum >= 3){m = sum % 3 + 1;} else if (sum > 1){m = sum - 1;} else{m = 1;}printf("The number of matches that have been moved by the computer is:%d\n", m);sum = sum - m;printf("The number of matches left is:%d\n", sum);if (sum == 0){printf("Congratulations!You won!\n");break;}}}return 0;
}

 

这篇关于MOOC哈工大2020C语言程序设计精髓练兵区编程题第十二周的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/516142

相关文章

C语言中位操作的实际应用举例

《C语言中位操作的实际应用举例》:本文主要介绍C语言中位操作的实际应用,总结了位操作的使用场景,并指出了需要注意的问题,如可读性、平台依赖性和溢出风险,文中通过代码介绍的非常详细,需要的朋友可以参... 目录1. 嵌入式系统与硬件寄存器操作2. 网络协议解析3. 图像处理与颜色编码4. 高效处理布尔标志集合

Go语言开发实现查询IP信息的MCP服务器

《Go语言开发实现查询IP信息的MCP服务器》随着MCP的快速普及和广泛应用,MCP服务器也层出不穷,本文将详细介绍如何在Go语言中使用go-mcp库来开发一个查询IP信息的MCP... 目录前言mcp-ip-geo 服务器目录结构说明查询 IP 信息功能实现工具实现工具管理查询单个 IP 信息工具的实现服

C 语言中enum枚举的定义和使用小结

《C语言中enum枚举的定义和使用小结》在C语言里,enum(枚举)是一种用户自定义的数据类型,它能够让你创建一组具名的整数常量,下面我会从定义、使用、特性等方面详细介绍enum,感兴趣的朋友一起看... 目录1、引言2、基本定义3、定义枚举变量4、自定义枚举常量的值5、枚举与switch语句结合使用6、枚

shell编程之函数与数组的使用详解

《shell编程之函数与数组的使用详解》:本文主要介绍shell编程之函数与数组的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录shell函数函数的用法俩个数求和系统资源监控并报警函数函数变量的作用范围函数的参数递归函数shell数组获取数组的长度读取某下的

Go 语言中的select语句详解及工作原理

《Go语言中的select语句详解及工作原理》在Go语言中,select语句是用于处理多个通道(channel)操作的一种控制结构,它类似于switch语句,本文给大家介绍Go语言中的select语... 目录Go 语言中的 select 是做什么的基本功能语法工作原理示例示例 1:监听多个通道示例 2:带

C语言函数递归实际应用举例详解

《C语言函数递归实际应用举例详解》程序调用自身的编程技巧称为递归,递归做为一种算法在程序设计语言中广泛应用,:本文主要介绍C语言函数递归实际应用举例的相关资料,文中通过代码介绍的非常详细,需要的朋... 目录前言一、递归的概念与思想二、递归的限制条件 三、递归的实际应用举例(一)求 n 的阶乘(二)顺序打印

揭秘Python Socket网络编程的7种硬核用法

《揭秘PythonSocket网络编程的7种硬核用法》Socket不仅能做聊天室,还能干一大堆硬核操作,这篇文章就带大家看看Python网络编程的7种超实用玩法,感兴趣的小伙伴可以跟随小编一起... 目录1.端口扫描器:探测开放端口2.简易 HTTP 服务器:10 秒搭个网页3.局域网游戏:多人联机对战4.

Java并发编程必备之Synchronized关键字深入解析

《Java并发编程必备之Synchronized关键字深入解析》本文我们深入探索了Java中的Synchronized关键字,包括其互斥性和可重入性的特性,文章详细介绍了Synchronized的三种... 目录一、前言二、Synchronized关键字2.1 Synchronized的特性1. 互斥2.

C语言中的数据类型强制转换

《C语言中的数据类型强制转换》:本文主要介绍C语言中的数据类型强制转换方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录C语言数据类型强制转换自动转换强制转换类型总结C语言数据类型强制转换强制类型转换:是通过类型转换运算来实现的,主要的数据类型转换分为自动转换

利用Go语言开发文件操作工具轻松处理所有文件

《利用Go语言开发文件操作工具轻松处理所有文件》在后端开发中,文件操作是一个非常常见但又容易出错的场景,本文小编要向大家介绍一个强大的Go语言文件操作工具库,它能帮你轻松处理各种文件操作场景... 目录为什么需要这个工具?核心功能详解1. 文件/目录存javascript在性检查2. 批量创建目录3. 文件