點我看題目
class Solution
{
public:
string mergeAlternately(string word1, string word2)
{
string result="";
int length1 = word1.length(), length2 = word2.length();
int minLength = min(length1, length2);
// 使用 for 循环交替添加字符
for (int i = 0; i < minLength; i++)
{
result += word1[i];
result += word2[i];
}
// 添加剩余的字符
for (int i = minLength; i < length1; i++)
{
result += word1[i];
}
for (int i = minLength; i < length2; i++)
{
result += word2[i];
}
return result;
}
};
- Nov 26 Sun 2023 15:06
leetcode 1768. Merge Strings Alternately
- Nov 25 Sat 2023 16:57
C++程式解題005
此題為出自zerojidge 基礎題005
以下是我寫出來的答案
#include <iostream>
using namespace std;
int main()
{
//先確認會有幾個數列
int n;
cin >> n;
//依次輸入每個數列的四個數字
for (int i = 0; i < n; i++)
{
int a, b, c, d;
cin >> a >> b >> c >> d;
// 判斷數列類型
if (b - a == c - b && c - b == d - c)
{
// 等差數列
int diff = b - a;
cout << a << " " << b << " " << c << " " << d << " " << d + diff << endl;
}
else if (b / a == c / b && c / b == d / c)
{
// 等比數列
int ratio = b / a;
cout << a << " " << b << " " << c << " " << d << " " << d * ratio << endl;
}
}
return 0;
}
- Nov 25 Sat 2023 16:20
C++程式解題004
- Nov 24 Fri 2023 23:47
台大WEBWORK 微積分1:11~14組 【7.5: Problem 1~Problem 4】
- Nov 24 Fri 2023 23:46
台大WEBWORK 微積分1:11~14組 【7.4: Problem 1~Problem 6】
- Nov 24 Fri 2023 23:45
台大WEBWORK 微積分1:11~14組 【7.3: Problem 1~Problem 5】
PROBLEM 01
(1 point) Evaluate the integral using the indicated trigonometric substitution. ∫10x39−x2−−−−−√dx,x=3sin(θ)
|
- Oct 30 Mon 2023 00:46
台大WEBWORK 微積分1:11~14組 【4.9: Problem 1~Problem 3】
PROBLEM 01
( 1 point) Find the most general antiderivative of f(x)=7x3−−√4−8x4−−√3. Note: Any arbitrary constants used must be an upper-case "C". |
- Oct 25 Wed 2023 23:56
Michael同學的家教紀錄【試教】
以下為試教內容
- Oct 25 Wed 2023 23:55
麥可同學的家教紀錄
以下是家教紀錄總整理
- Oct 25 Wed 2023 19:33
台大WEBWORK 微積分1:11~14組 【4.4: Problem 1~Problem 7】
PROBLEM 01
(1 point) Given that limx→af(x)=0, limx→ag(x)=0, limx→ah(x)=1, limx→ap(x)=∞, limx→aq(x)=∞. Which of the following limits are indeterminate forms? For those that are not an indeterminate form, evaluate the limit where possible. Enter I to indicate an indeterminate form, INF for positive infinity, NINF for negative infinity, and D for the limit does not exist or we don't have enough information to determine the limit. (a) limx→a[f(x)]g(x)= |
- Oct 09 Mon 2023 17:43
台大WEBWORK 微積分1:11~14組 【3.6: Problem 1~Problem 8】
- Oct 05 Thu 2023 23:44
台大WEBWORK 微積分1:11~14組 【3.4: Problem 1~Problem 6】
- Oct 05 Thu 2023 23:34
台大WEBWORK 微積分1:11~14組 【3.5: Problem 1~Problem 3】
- Sep 25 Mon 2023 16:56
台大WEBWORK 微積分1:11~14組 【3.1: Problem 1~Problem 3】
PROBLEM 01
(1 point) Find the equation of the tangent line to the curve y=xx√ at the point (16,64). y= |
- Sep 25 Mon 2023 16:51
台大WEBWORK 微積分1:11~14組 【2.8: Problem 1~Problem 2】
- Sep 25 Mon 2023 16:47
台大WEBWORK 微積分1:11~14組 【2.7: Problem 1~Problem 3】
PROBLEM 01
(1 point) Find the equation of the tangent line to the curve at the given point.
y=2x+1−−−−−√, (4,3)
|
- Sep 24 Sun 2023 23:57
台大微積分11~14班webeork詳解
- Sep 24 Sun 2023 23:52
台大WEBWORK 微積分1:11~14組 【2.6: Problem 1~Problem 5】
PROBLEM 01
(1 point) For the function g whose graph is given, state the following. (If the answer is positive infinite, type "I"; if negative infinite, type "N"; and if it does not exist, type "D".) (a)limx→∞g(x)(d)limx→0g(x)(b)limx→−∞g(x)(e)limx→−2+g(x)(c)limx→3g(x) |
- Sep 24 Sun 2023 23:31
台大WEBWORK 微積分1:11~14組 【2.5: Problem 1~Problem 5】
- Sep 21 Thu 2023 21:18
台大WEBWORK 微積分1:11~14組 【2.3: Problem 1~Problem 5】
PROBLEM 01
(1 point) Evaluate the limit, if it exists. If not, enter "n" below. limt→99−t3−t√ |