源码: # include<stdio.h> int main(void){int a,i=0,sum=0;scanf("%d",&a);if(a<0) a=-a;//求负整数的while(a){sum+=(a%10);//sum存各位数之和a/=10;}printf("各位数字之和为:%d\n", ...
分类:
编程语言 时间:
2021-05-25 18:29:36
阅读次数:
0
define连接字符串 #define conn(x,y) x##y,连接x与y #define toString(x) #x,将x变成字符串 #include <stdio.h> #define conn(x,y) x##y #define toChar(x) #x int main(void) ...
分类:
其他好文 时间:
2021-05-25 18:17:24
阅读次数:
0
Array.prototype.filter filter() 方法创建一个新数组, 其包含通过所提供函数实现的测试的所有元素。 语法 var newArray = arr.filter(callback(element[, index[, array]])[, thisArg]) 参数 callb ...
分类:
Web程序 时间:
2021-05-25 18:03:20
阅读次数:
0
在复习归并排序的时候,使用到了递归,我一直以为是递归函数没写对,导致了Maximum call stack size exceeded 栈溢出,但是其实是JavaScript浮点数的自动转换的问题! function sort(arry,left,right){ if(left right){ re ...
分类:
编程语言 时间:
2021-05-25 17:48:06
阅读次数:
0
TableView 的TableColumn有文本换行的需求。 方法如下: @FXML private TableColumn nameCol; nameCol.setCellValueFactory(new PropertyValueFactory<>("name")); //姓名 初始化name ...
分类:
编程语言 时间:
2021-05-25 17:45:25
阅读次数:
0
O(logn)最长上升子序列并输出 +++ pre数组记录转移。 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N = 1e6 ...
分类:
其他好文 时间:
2021-05-25 17:36:48
阅读次数:
0
public htmlToText(html: string) { return html .replace(/<br>/g, '') .replace(/<p>/g, '') .replace(/<\/p>/g, '') .replace(/<\s*b[^>]*>/g, '') .replace( ...
分类:
Web程序 时间:
2021-05-24 17:18:14
阅读次数:
0
const axios=require('axios') const fs = require('fs-extra'); const https=require('https') const path=require('path') function resolve (dir) { return p ...
分类:
Web程序 时间:
2021-05-24 17:11:19
阅读次数:
0
ES6新增了一些字符串方法以及一些数组方法,使数组跟字符串的操作都变得更方便快速。其中字符串新增的方法有includes(),startWith(),endsWith(),repeat()。数组新增的方法有form(),find(),findIndex()。 接下来我们一个个去看它们的用法: inc ...
分类:
其他好文 时间:
2021-05-24 17:06:50
阅读次数:
0
import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.springframework.core.io.Resource; import org.springframework.core ...
分类:
编程语言 时间:
2021-05-24 17:06:24
阅读次数:
0