鱼C论坛

 找回密码
 立即注册
分享 使用 reduce 方法分析数据
hayeee 2024-12-10 13:38
Array.prototype.reduce(), or simplyreduce(), is the most general of all array operations in JavaScript. You can solve almost any array processing problem using thereducemethod. reduce方法是处理数组更通用的方式,而且filter和map方法都可以当作是r ...
0 个评论
分享 删除字符串中的数字,字符不能直接和数字相比
Maliaty 2024-12-8 23:06
#include Stdio.h #include string.h int fun ( char a ) { int length = strlen ( a ); int sum = 0 ; for ( int i = 0 ; i length ; i ++ ) { if ( a == 1 || a == 2 || a == 3 || a == 4 || ...
1 个评论
分享 在main函数里面,while循环的判断条件里面,不用回车来判断结束,可用strlen,利用长 ...
Maliaty 2024-12-8 22:31
#includestdio.h #includestring.h #define MAX 50 void f1(char str , int *length) { int x, y = 0, maxlength = 0, max_start = 0, end = 0, wordstart = 0; for (x = 0; x = *length; x++) { if (str != ' ' ...
2 个评论
分享 将str1字符串中的元音字母(a、e、i、o、u 或 A、E、I、O、U)复制到另一个字符串str2
Maliaty 2024-12-4 19:58
#include stdio.h #define MAX 20 void f1 ( char str1 ); void f1 ( char str1 ) { int j = 0 ; for ( int i = 0 ; i * length ; i ++ ) { if ( str1 == 'a' || ...
1 次阅读|0 个评论
分享 字符串transpose,利用getchar来接收单个字符并存储到数组,一定要自己加‘\0’
Maliaty 2024-12-3 17:36
#include stdio.h #define MAX 20 void transpose ( char str , int length ) { int temp ; for ( int j = 0 ; j length / 2 ; j ++ ) { temp = str ; str ...
1 个评论
分享 定义二维数组函数,交换时避免重复交换
Maliaty 2024-12-3 16:59
#include stdio.h int main () { void change ( int str ); int str ; for ( int i = 0 ; i 3 ; i ++) { for ( int j = 0 ; j 3 ; j ++)   ...
0 个评论
分享 函数调用指针与直接调用数在主函数的区别,怎么使用指针改变数据
Maliaty 2024-12-3 15:02
#include stdio.h void swap ( int x , int y ); void swap ( int x , int y ) { int temp ; printf ( "in swap, 转换前x= %d , y= %d \n " , x , y ); temp = x ; x = y ; y = temp ; printf ...
3 个评论
分享 基本类型布尔值的检查
hayeee 2024-12-2 13:54
检查某个值是否被归类为布尔基元。返回 true 或 false 。 基本类型中的布尔值为true或者false。 ------------------------------------------------- function booWho(bool) { return typeof bool === "boolean"; } // test here booWho(null);
0 个评论
分享 按参数过滤数组
hayeee 2024-12-2 13:06
创建一个函数,查看数组 arr 并返回其中第一个通过“真值测试”的元素。这意味着,给定一个元素,如果 为, x 则通过“真值测试” 。如果没有元素通过测试,则返回 。 func(x) true undefined ---------------------------------------------- function findElement ( arr , func ...
0 个评论
分享 孪生素数
Maliaty 2024-11-29 11:12
#include stdio.h #define MAX 100 #include stdbool.h bool prime ( int n ); bool prime ( n ) { int i ; if ( n == 1 ) return true ; if ( n == 2 ) return false ; for ( i = 2 ; i ...
2 个评论

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-3-26 18:40

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

返回顶部