下面是别人给我的代码: package com.bootdo; public class Test { public static void main(String[] args) { System.out.println(multiply("2354343543543", "3213213213")); } public static String multiply(String num1, String num2) { int l = num1.length()
"""思路:1.a * b = a + a + a + ... 2.a * b = n个a相加,只需求证b = n即可 3.用for 循环遍历即可,b就是range的最大次数 4.需考虑a,b有五种情况存在,但结果会有三种,正数,0,负数""" def multiplication(a,b): if a > 0 and b > 0: sum = 0 for i in range(b): sum += a print(sum) elif
请看题目描述: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. Input: (2 -> 4 -> 3) + (5 ->
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. You may assume the two numbers