週中練習1

2021-08-20 06:05:50 字數 931 閱讀 7295



a gym 101652n

給乙個字串,看字串中是否所有回文串為奇數,輸出odd,否則not odd。字串很短,三重迴圈判斷。

#include #includeusing namespace std;

char s[110];

int main()

}if(f==0 && l%2==0)

}if(flag==1)

break;

}if(flag==0)

cout<<"odd."給n*n的地圖,乙個字元每行每列只能出現一次,否則 no ;再看是否第一行、第一列均為遞增,是則 reduced; 否則 not reduced。

#include#include#includeusing namespace std;

mapmp;

char s[40][40];

int vis[40];

int main()

c='a';

for(int i=10; i<=36; i++)

int n;

while(cin>>n && n)

int no=0;

for(int i=0; ic gym 101652q

給n,讓1開始,讓1與2、3、4、、、組合,輸出1;2與3、4、5、、、組合,輸出2;。。。。求一半時輸出幾?

#includeusing namespace std;

typedef long long ll;

int main()

{ ll n, sum;

cin>>n;

sum=(n-1)*n/2;

sum=(sum+1)/2;

int i=1, j=1;

ll temp=0;

for(i=n-1,j=1; j=sum) //大於一半時

{cout<

第二週中級練習

題目內容 輸入4字元的單詞 小寫 將每個字母轉換為其在字母表中的序號 00 25 輸出 不夠兩位的前面補0 例如,輸入atom,輸出00191412 輸入格式 連續的四個小寫字母,表示乙個4字母單詞。輸出格式 8個0 9的數字,中間無空格。輸入樣例 atom 輸出樣例 時間限制 500ms記憶體限制...

第三週中級練習

題目內容 輸入n 0輸入格式 整數n 0輸出格式 非負整數 輸入樣例 輸出樣例 include using namespace std intmain cout return0 題目內容 求a aa aaa aaaa aa a 第n項,n個a 其中a是1 9的整數。例如,a 1,n 3時,式子為1 ...

第3周中級練習 owefhowefwef

1.計算1 2 3 n 題目內容 輸入n 0 輸入n 0 include using namespace std intmain cout sum return0 2.題目內容 求a aa aaa aaaa aa a 第n項,n個a 其中a是1 9的整數。例如,a 1,n 3時,式子為1 11 11...