趨勢科技筆試程式設計題

2021-08-20 03:02:07 字數 587 閱讀 9054

題目描述:給定乙個由小寫英文本母構成的字串s,求不含重複字母的子串的最大長度

^_^題目記得不大清楚了。。。

例如:輸入:abcde

輸出:4

#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;

string str;

int book[26];

int judge(int l,int r)

if(i==r)

return 1;

else

return 0;

}int main()}}

return 0;

}

一年不刷題的我在筆試時竟然沒有做出這道題,原因有兩點:時間緊,平時太依賴編譯器(筆試的時候是直接在網頁裡面敲**)。這道題用簡單模擬就可以了,題目說找最大長度,所以應該從最大長度開始找,一次減一,直到找到滿足條件的長度即可。

筆試 程式設計題

1.class a class b public a int main 2.int main 3.int func int a int main little endian int main char p char a 2 printf 0x x,0x x,0x x p 1 p,short p re...

趨勢科技程式設計題

給定乙個整數陣列a,擁有n個不重複的整數。找到陣列中兩個數之和出現最多的和,如果有多種可能,輸出全部結果 結果順序任意 分數 15 輸入格式 第一行 n 陣列個數 第二行 n個空格分隔的整數 輸出格式 列印輸出結果,多個結果多行顯示。樣本輸入 81 8 3 11 4 9 2 7 樣本輸出 1110 ...

商湯科技2021秋招筆試程式設計題

1 找出字串中能組成 good 的個數有幾個,不能改變字元在串中的相對位置 include using namespace std int a 100001 intmain else if s j o flag 1 a j 0 break cout 2 給乙個矩陣,每個位置可上下左右移動,問,在移動...