點我看題目

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;
    }
};

戰昇 發表在 痞客邦 留言(0) 人氣()

 

此題為出自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;
}



戰昇 發表在 痞客邦 留言(0) 人氣()

此題為出自zerojidge 基礎題004

點我觀看題目

以下是我寫出來的答案

 


#include <iostream>
using namespace std;


int main()
{
        int year;//因為year是整數 
        
        while(cin>>year)//只要使用者持續輸入,就會一直執行迴圈 
        {
        //此為判斷是否為閏年 
                if((year%4==0&&year%100!=0)||year%400==0)
                        cout<<"閏年"<<"\n";//記得要用換行符號 
                else
                        cout<<"平年"<<"\n";
                
        }
        return 0;

}

戰昇 發表在 痞客邦 留言(0) 人氣()

PROBLEM 01

 

 

 

 

戰昇 發表在 痞客邦 留言(0) 人氣()

PROBLEM 01

 

 

 

 

戰昇 發表在 痞客邦 留言(0) 人氣()

PROBLEM 01

(1 point)

Evaluate the integral using the indicated trigonometric substitution.

10x39x2dx,x=3sin(θ)∫10�39−�2��,�=3sin⁡(�)

 

文章標籤

戰昇 發表在 痞客邦 留言(0) 人氣()

PROBLEM 01

(

1 point)

Find the most general antiderivative of f(x)=7x348x43.�(�)=7�34−8�43.

Note: Any arbitrary constants used must be an upper-case "C".

文章標籤

戰昇 發表在 痞客邦 留言(0) 人氣()

以下為試教內容


戰昇 發表在 痞客邦 留言(0) 人氣()

以下是家教紀錄總整理


戰昇 發表在 痞客邦 留言(0) 人氣()

PROBLEM 01

(1 point)

Given that limxaf(x)=0, limxag(x)=0, limxah(x)=1, limxap(x)=, limxaq(x)=lim�→��(�)=0, lim�→��(�)=0, lim�→�ℎ(�)=1, lim�→��(�)=∞, lim�→��(�)=∞.

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) limxa[f(x)]g(x)=lim�→�[�(�)]�(�)= 

文章標籤

戰昇 發表在 痞客邦 留言(0) 人氣()

PROBLEM 01

(1 point) Differentiate f(t)=ln(cost)�(�)=ln⁡(cos⁡�).

f(t)=�′(�)= 

台大WEBWORK 微積分1:11~14組 【3.6: Pr

文章標籤

戰昇 發表在 痞客邦 留言(0) 人氣()

PROBLEM 01

(1 point)

Differentiate y=103x2�=103−�2.

y=�′= 

文章標籤

戰昇 發表在 痞客邦 留言(0) 人氣()

PROBLEM 01

(1 point) Find dy/dx��/�� by implicit differentiation.

tan(xy)=y1+x2tan⁡(�−�)=�1+�2

 

dydx=����= 

文章標籤

戰昇 發表在 痞客邦 留言(0) 人氣()

PROBLEM 01

(1 point)

Find the equation of the tangent line to the curve y=xx�=�� at the point (16,64)(16,64).

y=�= 

台大WEBWORK 微積分1:11~14組 【3.1: Pr

文章標籤

戰昇 發表在 痞客邦 留言(0) 人氣()

 

PROBLEM 01

(1 point) Match the graph of each function in A through D with the graph of its derivative 1 through 4 below.

 

台大WEBWORK 微積分1:11~14組 【2.8: Pr   台大WEBWORK 微積分1:11~14組 【2.8: Pr
 
A   B
 
台大WEBWORK 微積分1:11~14組 【2.8: Pr   台大WEBWORK 微積分1:11~14組 【2.8: Pr
 
C   D

 

文章標籤

戰昇 發表在 痞客邦 留言(0) 人氣()

PROBLEM 01

(1 point)

Find the equation of the tangent line to the curve at the given point.

 

y=2x+1,  (4,3)�=2�+1,  (4,3)

戰昇 發表在 痞客邦 留言(0) 人氣()

 

 

2.1
 
 

 


戰昇 發表在 痞客邦 留言(0) 人氣()

 

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)limxg(x)(d)limx0g(x)(b)limxg(x)(e)limx2+g(x)(c)limx3g(x)(�)lim�→∞�(�)(�)lim�→−∞�(�)(�)lim�→3�(�)(�)lim�→0�(�)(�)lim�→−2+�(�)

戰昇 發表在 痞客邦 留言(0) 人氣()

 

PROBLEM 01

(1 point)

Why is the following function discontinuous at x=0�=0?

 

戰昇 發表在 痞客邦 留言(0) 人氣()

PROBLEM 01

(1 point)

Evaluate the limit, if it exists. If not, enter "n" below.

limt99t3tlim�→99−�3−�

戰昇 發表在 痞客邦 留言(0) 人氣()