18年西工大碩士研究生入學考試複試機試解答

2021-09-07 05:57:47 字數 1792 閱讀 2669

/**************************************

*headline: 18年瓜大機試解答

*author: 周小楓

*email: [email protected]

*date: 2019-1-4

*brief: 這是乙份菜雞幫更菜的雞寫的參

考code,經測試,以下code都ok,如有錯誤

歡迎大佬指正,

**************************************/

1:求積

#include

using

namespace std;

intmain()

return

0;

2:階乘

#include

using

namespace std;

intmain()

cout<<

"the jiecheng of i is :"

<}return0;

}

3:c(n,m),排列組合

#include

using

namespace std;

intmain()

cout<<

"the result is :"

}

4:n組數,每組m個,每組數由小到大排序輸出

#include

using

namespace std;

void

mysort

(int

* a,

int m)}}

intmain()

for(

int i=

0;i)mysort

(a[i]

,m);

//暫時用的冒泡,後面除錯下快排

for(

int i=

0;i) cout<}return0;

}

5:字串反轉

#include

using

namespace std;

intmain()

return0;

}

6:判斷是否「回文」,即從字串左右看都一樣

#include

#include

using

namespace std;

intmain()

else}if

(flag ==

true

) cout<<

"yes"

cout<<

"no"

<}return0;

}

7:括號匹配

#include

#include

using

namespace std;

intmain()

':if(st[

--top]!='

}if((flag==

true

)&&top==0)

//棧空且flag為true

cout<<

"yes"

cout<<

"no"

<}return0;

}

Python 2023年北航研究生入學考試機試題

問題描述 某些整數能分解成若干個連續整數的和的形式,例如 15 1 2 3 4 5 15 4 5 6 15 7 8 某些整數不能分解為連續整數的和,例如 16 輸入形式 乙個整數n n 10000 輸出形式 整數n對應的所有分解組合,如果沒有任何分解組合,則輸出none。樣例輸入 15 樣例輸出 1...

2023年全國碩士研究生招生進入複試

報考學科門類 專業 a類考生 b類考生 c類考生 總分單科 滿分 100分 單科 滿分 100分 總分單科 滿分 100分 單科 滿分 100分 總分單科 滿分 100分 單科 滿分 100分 哲學 01 30546 69300 4466 29541 62經濟學 02 32553 80320 517...

河海大學2023年碩士研究生招考公告

河海大學建於1915年,是一所擁有百餘年辦學歷史,以水利為特色,工科為主,多學科協調發展的教育部直屬全國重點大學,是實施國家 211工程 重點建設 國家優勢學科創新平台建設 一流學科建設以及設立研究生院的高校。我校研究生教育始於50年代,是國家首批授權授予學士 碩士和博士學位的高校之一。水利工程 環...