数字分离(c语言) 解题思路:我们可以使用一个数组来存储输入的数,然后在利用循环输出。当我们不知道数组里面存了多少个数时,我们可以利用字符数组的最后一个结束符('\0')来作为循环的判断条件。注意事项:'\0'在用gets输入是系统自动添加的。参考代码:```c#includeintmain(){chara[100];g 题解列表 2022年11月27日 0 点赞 0 评论 562 浏览 评分:9.9
利用循环查找元音字母 解题思路:定义2个字符数组,利用循环在字符数组里查找元音字母,如找到了则赋值给另外一个字符数组,然后输出。```c#includeintmain(){chara[100];charb[100];scanf("%s",&a);//输入字符串给字符数组ainti, 题解列表 2022年11月27日 0 点赞 0 评论 539 浏览 评分:9.9
一种超简单的方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m,n,i; char str[100]; scanf("%d",&n); ge…… 题解列表 2022年11月27日 0 点赞 0 评论 448 浏览 评分:0.0
优化求解---第n小的质数 注意事项:优化求解过程。优化1:第二层for循环中的sqrt(i),因数都是成对出现的。比如,100的因数有:1和100,2和50,4和25,5和20,10和10。看出来没有?成对的因数,其中一个必然小于等于100的开平方,另一个大于等于100的开平方。 题解列表 2022年11月27日 0 点赞 0 评论 624 浏览 评分:0.0
常规解法级数求和 摘要:结果:i = 1835421 Sn = 15.000000参考代码:#include<stdio.h>int main() { int k; double Sn = 0; scanf("%d",&k)…… 题解列表 2022年11月27日 0 点赞 0 评论 539 浏览 评分:0.0
自定义函数之字符串反转 摘要:解题思路:最简洁注意事项:参考代码:#include<stdio.h>#include<string.h>int fun(char a[]){ int n = strlen(a); return n;…… 题解列表 2022年11月27日 0 点赞 0 评论 351 浏览 评分:9.9
矩阵转换(矩阵转换) 解题思路:将原先的m行n列,变为n行m列。感谢大佬的思路,我真是个天才注意事项:参考代码:#includeintmain(){inti,j,m,n;inta[500][500];scanf("%d%d",&m,&n);for(i=0;i 题解列表 2022年11月27日 0 点赞 0 评论 721 浏览 评分:9.3 计算矩阵边缘元素之和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a[500][500]; int i,j,m,n; int sum=0; scanf("%d %d",&…… 题解列表 2022年11月27日 0 点赞 0 评论 549 浏览 评分:0.0 二级C语言-进制转换 %o解法与通解 摘要:第一种解法,直接用printf的%o格式打印。 ```c #include int main(){ int n; scanf("%d",&n); printf("%…… 题解列表 2022年11月27日 0 点赞 0 评论 649 浏览 评分:9.9 跟原先不使用函数一样的道理-C语言解决 摘要:解题思路:注意事项:参考代码:#include<stdio.h> void max(int a, int b, int c) { int max = 0; if (a > b) ma…… 题解列表 2022年11月27日 0 点赞 1 评论 650 浏览 评分:9.9 « 12...720721722723724725726...29572958 »
计算矩阵边缘元素之和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a[500][500]; int i,j,m,n; int sum=0; scanf("%d %d",&…… 题解列表 2022年11月27日 0 点赞 0 评论 549 浏览 评分:0.0
二级C语言-进制转换 %o解法与通解 摘要:第一种解法,直接用printf的%o格式打印。 ```c #include int main(){ int n; scanf("%d",&n); printf("%…… 题解列表 2022年11月27日 0 点赞 0 评论 649 浏览 评分:9.9
跟原先不使用函数一样的道理-C语言解决 摘要:解题思路:注意事项:参考代码:#include<stdio.h> void max(int a, int b, int c) { int max = 0; if (a > b) ma…… 题解列表 2022年11月27日 0 点赞 1 评论 650 浏览 评分:9.9