题解列表

筛选

C++树的直径求解代码

摘要:解题思路:根据题意发现从首都出发每个大城市只有一条路,所以可以确定 这个结构是一棵树,所以可以先求出树的直径(树中长度最长的路径),再算出费用求出直径的步骤任取一点a对a做一遍深搜求出距离a最远的点b……

题解 1668: printf基础练习2

摘要:解题思路:注意事项:参考代码:#include <stdio.h> int main()  {     int num;     // 读取输入整数     scanf("%d", &n……

字符类型统计

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int *tongji(char *a){ int i; static int b[4]={0}; for(i=0;*(a+i)!=&#……

实行强行转换类型

摘要:解题思路:把浮点数赋值给整数实现强行转换注意事项:记得加括号参考代码:#include<stdio.h>int main(){ float a; scanf("%f", &a); int b = (i……

自定义函数之字符提取

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>char *yuanyin(char *a){ int i,j; static char b[100……

C语言自定义函数字符链接

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>char *lianjie(char *a,char *b){ strcat(a,b); retur……

借鉴了一下,略磨出厂,可大刀

摘要:解题思路:可以举几个十进制数字转化二进制的例子,用脑汁稍微思考就会了注意事项:参考代码:#include <stdio.h>int main(){ int a[32];//int型4个字节转二进制32……

去掉空格 c语言

摘要:解题思路:注意事项:参考代码:                        #include <stdio.h>           &nb