摘要:
给你一个整数 n,请你帮忙计算并返回该整数「各位数字之积」与「各位数字之和」的差。 直接法: class Solution { public: int subtractProductAndSum(int n) { int sum = 0, product = 1; while (n) { sum + 阅读全文
摘要:
给你一个由小写英文字母组成的字符串 s ,请你找出并返回第一个出现 两次 的字母。 注意: 如果 a 的 第二次 出现比 b 的 第二次 出现在字符串中的位置更靠前,则认为字母 a 在字母 b 之前出现两次。 2 <= s.length <= 100 s 由小写英文字母组成 s 包含至少一个重复字母 阅读全文
摘要:
public class test{ public void info(int...nums) { for(int num : nums) { System.out.println(num); } } public static void main(String args[]) { test t = 阅读全文