陣列模擬加法(每日一練 11 30)

2021-09-02 08:00:14 字數 749 閱讀 4285

calculate a + b.

each line will contain two integers a and b. process to end of file. (eof)

for each case, output a + b in one line.

2 34 559

思路:調皮的毛學姐又整出一道很坑的題,開始我以為就是簡單的a+b,在 wa 3次後我意識到這題的資料有很大的bug,大到long long都呈不下,所以這種情況只能用陣列模擬求和的方法來做。**如下:

#include

#include

intmain()

return0;

}

用vector的方法

#include

#include

using namespace std;

const

int n =

1e6+10;

string s1, s2;

vector<

int> a, b, c;

vector<

int>

add(vector<

int> a, vector<

int> b)

if(t)c.

push_back

(t);

return c;

}int

main()

每日一練4

員工表emp 員工編號eid,姓名ename,工作職位title,僱傭日期hiretime,工資salary,獎金bonus,部門depart 部門表dept 部門編號did,名稱dname,部門領導leader 員工資料 1001,張三 銷售 1999 12 1 3000.0,1100.0,102...

每日一練25

請描述 mysql 從安裝到配置的全部詳細過程 確保一台新電腦可以順利使用 mysql mysql安裝嚮導啟動,按 next 繼續 選擇安裝型別,有 typical 預設 complete 完全 custom 使用者自定義 三個選項,我們選擇 custom 有更多的選項,也方便熟悉安裝過程 選擇配置...

每日一練 13

談談你對ajax 的理解?概念 特點 作用 select 教師號,sum case when 星期號 1 and 是否有課 有 then 1 else 0 end as 星期一,sum case when 星期號 2 and 是否有課 有 then 1 else 0 end as 星期二,sum c...