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;}
文章目录 .net framwork4.6操作MySQL报错Character set ‘utf8mb3‘ is not supported 解决方法详细报错内容解决方案修改数据修改表修改字段 .net framwork4.6操作MySQL报错Character set ‘utf8mb3‘ is not supported 解决方法
详细报错内容
System.NotSupportedException…