intChickenRabbit(int* chicken,int* rabbit,int head,int foot){int i;int j;if(foot %2!=0&& head <0&& foot <0){return0;}for(i =0; i <= head; i++){j = head - i;if(i *2+ j *4== foot){*chicken = i;*rabbit = j;return1;}}return0;}
6-2 冒泡排序
voidbubble(int a[],int n){int i, j;for(i =0; i < n -1; i++){int flag =1;for(j =0; j < n - i -1; j++){if(a[j]> a[j +1]){int tmp = a[j];a[j]= a[j +1];a[j +1]= tmp;flag =0;}}if(flag ==1)break;}}
6-3 字符串反正序连接
#include<string.h>voidfun(char* s,char* t){char* str = s;int len =strlen(s);int j =0;for(int i = len -1; i >=0; i--){t[j]= str[i];j++;}t[j]='\0';strcat(t, s);}
6-4 计算最长的字符串长度
intmax_len(char* s[],int n){int max =0;for(int i =0; i < n; i++){if(strlen(s[i])> max)max =strlen(s[i]);}return max;}
github官网GitHub - video-dev/hls.js: HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.HLS.js is a JavaScript library that plays HLS in browsers with support for MSE. - GitHub - video-dev/hls.js: HLS.js is a JavaScript library …