演算法訓練 大小寫判斷
問題描述
給定一個英文字母判斷這個字母是大寫還是小寫。
輸入格式
輸入只包含一個英文字母c。
輸出格式
如果c是大寫字母,輸出“upper”,否則輸出“lower”。
樣例輸入
x
樣例輸出
lower
樣例輸入
B
樣例輸出
upper
#include<iostream> #include<cstdlib> #include<string> using namespace std; int main() { string s; cin >> s; if(isupper(s[0])) cout << "upper" << endl; else cout << "lower" << endl; return 0; }
相關推薦
演算法訓練 大小寫判斷
問題描述 給定一個英文字母判斷這個字母是大寫還是小寫。 輸入格式 輸入只包含一個英文字母c。 輸出格式 如果c是大寫字母,輸出“upper”,否則輸出“lower”。 樣例輸入
ALGO-64 演算法訓練 大小寫判斷
演算法訓練 大小寫判斷 時間限制:1.0s 記憶體限制:512.0MB 問題描述 給定一個英文字母判斷這個字母是大寫還是小寫。 輸入格式 輸入只包含一個英文字母c。 輸出格式
藍橋杯演算法訓練 大小寫轉換
演算法訓練 大小寫轉換 時間限制:1.0s 記憶體限制:512.0MB問題描述 編寫一個程式,輸入一個字串(長度不超過20),然後把這個字串內的每一個字元進行大小寫變換,即將大寫字母變成小寫,小
藍橋杯之演算法訓練 大小寫轉換
題目:演算法訓練 大小寫轉換 問題描述 編寫一個程式,輸入一個字串(長度不超過20),然後把這個字串內的每一個字元進行大小寫變換,即將大寫字母變成小寫,小寫字母變成大寫,然後把這個新的字串輸出。 輸入格式:輸入一個字串,而且這個字串當中只包含英文字
演算法訓練 大小寫轉換
問題描述 編寫一個程式,輸入一個字串(長度不超過20),然後把這個字串內的每一個字元進行大小寫變換,即將大寫字母變成小寫,小寫字母變成大寫,然後把這個新的字串輸出。 輸入格式:輸入一個字串,
藍橋杯——演算法訓練 大小寫轉換
問題描述 編寫一個程式,輸入一個字串(長度不超過20),然後把這個字串內的每一個字元進行大小寫變換,即將大寫字母變成小寫,小寫字母變成大寫,然後把這個新的字串輸出。 輸入格式:輸入一個字串,而且這個字串當中只包含英文字母,不包含其他型別的字元,也沒有空格
藍橋杯試題集 演算法訓練 大小寫轉換
演算法訓練 大小寫轉換 時間限制:1.0s 記憶體限制:512.0MB 問題描述 編寫一個程式,輸入一個字串(長度不超過20),然後把這個字串內的每一個字元進行大小寫
藍橋杯 演算法訓練 ALGO-84 大小寫轉換 字元操作
演算法訓練 大小寫轉換 時間限制:1.0s 記憶體限制:512.0MB 提交此題 問題描述 編寫一個程式,輸入一個字串(長度不超過20),然後把這個字串內的每一個字元進行大小寫變換,即將大寫字母變成小寫,小寫字母變成大寫,然後把這個新的字串輸出。 輸入格式:輸入一個字串,而且
藍橋杯 ALGO-61 演算法訓練 奇偶判斷
演算法訓練 奇偶判斷 時間限制:1.0s 記憶體限制:512.0MB 問題描述 能被2整除的數稱為偶數,不能被2整除的數稱為奇數。給一個整數x,判斷x是奇數還是偶數。 輸入格式 輸入包括
ALGO-65演算法訓練 比賽安排 (陣列記錄判斷)
演算法訓練 比賽安排 時間限制:1.0s 記憶體限制:512.0MB 問題描述 設有有2 n(n<=6)個球隊進行單迴圈比賽,計劃在2 n – 1天內完成,每個隊
藍橋杯-演算法訓練-ALGO-84-大小寫轉換
大小寫轉換 問題描述 編寫一個程式,輸入一個字串(長度不超過20),然後把這個字串內的每一個字元進行大小寫變換,即將大寫字母變成小寫,小寫字母變成大寫,然後把這個新的字串輸出。 輸入格式:輸入一個字串,而且這個字串當中只包含英文字母,不包含其他型別的字元,也沒有空格。 輸
密碼傳紙條演算法訓練 -- python 實現
今天幫朋友解了一個很有意思的問題 -- 傳紙條,(要求用python實現)題目如下: 李雷和韓梅梅坐前後排,上課想說話怕被老師發現,所以改為傳小紙條。為了不被老師發現他們紙條上說的是啥,他們約定了如下方法傳遞資訊: 將26個英文字母(全為大寫),外加空格,一共27個字元分成3組,每組9個。也就是
Faster RCNN演算法訓練程式碼解析(2)
接著上篇的部落格,我們獲取imdb和roidb的資料後,就可以搭建網路進行訓練了。 我們回到trian_rpn()函式裡面,此時執行完了roidb, imdb = get_roidb(imdb_name),取得了imdb和roidb資料。 先進入第一階段的訓練: print
Faster RCNN演算法訓練程式碼解析(3)
四個層的forward函式分析: RoIDataLayer:讀資料,隨機打亂等 AnchorTargetLayer:輸出所有anchors(這裡分析這個) ProposalLayer:用產生的anchors平移整圖,裁剪出界、移除低於閾值的的anchors,排序後使用nms,返回頂部排名的anchors
演算法訓練--數字盒子
/*題目:對於一個盒子S,要求進行插入以及刪除操作,輸出是否操作成功 數字的範圍:10^5(60%)~10^18 */#include <bits/stdc++.h>using namespace std;//Mod:雜湊函式的模數//table:雜湊表 const int Mod = 10000
Leetcode演算法——36、判斷有效數獨
判斷一個 9*9 的數獨面板是否是有效的。 如果已經被填充的數字滿足以下條件,則說明是有效的: 每一行只能包含無重複數字1-9 每一列只能包含無重複數字1-9 每一個 3*3 的子面板只能包含無重複數字1-9 備註: 一個有效的數獨面板(
演算法訓練(五)
1.gym 101755A a=c⋅g,b=d⋅g,s=a+b=(c+d)⋅g 故若g%s==0且s>g則a=g,b=s−g顯然符合條件,否則無解 #include<cstdio> #include<iostream> #include<cstring&
演算法訓練(三)
1.zoj-4026 首先我們需要推倒一下,每次都是從A開始拿,可以列舉幾種情況,會發現最後結束一定是在第四次抽到A的時候結束的,因為假設在第二堆結束,你在抽完4次2後第二堆才為空,你需要第五次抽到2才會回到第二堆,這時候才能結束,不符合題意,因此只有第一次就被抽的A能結束遊戲,因此結束的時候一定為A,因此
演算法訓練(六)
1.gym 101775A 本題是一個 C(n,k)+C(n,k+1)+...+C(n,n) 的過程,暴力會超時,轉化為 2^n - C(n,0)+C(n,1)+...+C(n,k-1); 利用費馬小定理(假如p是質數,且gcd(a,p)=1,那麼 a(p-1)≡1(mod p),即:假如a是整
藍橋杯 演算法訓練 字母圖形
問題描述 利用字母可以組成一些美麗的圖形,下面給出了一個例子: ABCDEFG BABCDEF CBABCDE DCBABCD EDCBABC 這是一個5行7列的圖形,請找出這個圖形的規律,並輸出一個n行m列的圖形。 輸入格式 輸入一行