1 Star 12 Fork 4

China-1977 / life

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.en.md 2.91 KB
一键复制 编辑 原始数据 按行查看 历史
王长康 提交于 2024-05-12 08:50 . .
sudo su
dpkg -i 
apt install rpm
rpm -ivh jdk-21_linux-x64_bin.rpm

tar -zxvf nginx-1.24.0.tar.gz

apt-get install openssl openssl
apt-get install libssl-dev

./configure --with-http_stub_status_module --with-http_ssl_module

./configure --add-dynamic-module=path/to/nginx-upstream-dynamic-servers
make
make install


make install

$ vim /etc/profile
#maven
export MAVEN_HOME=/home/wangchangkang/apache-maven-3.9.5
export PATH=$MAVEN_HOME/bin:$PATH

source /etc/profile
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

 public class Test {

        /**
         * @param money   总金额
         * @param balance 剩余面额
         */
        public static HashMap<BigDecimal, BigDecimal> get(BigDecimal money, TreeMap<BigDecimal, BigDecimal> balance) {
            log.info("兑换前剩余面额:{}", balance);
            HashMap<BigDecimal, BigDecimal> data = new HashMap<>();
            for (Map.Entry<BigDecimal, BigDecimal> entry : balance.descendingMap().entrySet()) {
                BigDecimal key = entry.getKey();// 面额
                BigDecimal value = entry.getValue(); // 张数
                if (value.compareTo(BigDecimal.ZERO) > 0) {
                    BigDecimal[] result = money.divideAndRemainder(key);
                    BigDecimal discuss = result[0]; // 商-张数
                    BigDecimal remainder = result[1]; // 余-金额
                    if (discuss.compareTo(BigDecimal.ZERO) == 0) {
                        // 商等于0,说明当前金额小于当前面额
                        data.put(key, BigDecimal.ZERO);
                        money = remainder;
                    } else {
                        int i = discuss.compareTo(value);
                        if (i >= 0) {
                            //商大于剩余张数
                            data.put(key, value);
                            money = money.subtract(key.multiply(value));
                            entry.setValue(BigDecimal.ZERO);
                        } else {
                            //商小于剩余张数
                            data.put(key, discuss);
                            money = remainder;
                            entry.setValue(value.subtract(discuss));
                        }
                    }
                }
            }
            log.info("兑换后剩余面额:{}", balance);
            log.info("兑换面额:{}", data);
            return data;
        }
    }

根据土壤检查自动浇水 根据水质自动换水

Java
1
https://gitee.com/china-1977/life.git
git@gitee.com:china-1977/life.git
china-1977
life
life
master

搜索帮助