ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#156037 | #1146. 整理药名 | noi_yangge | 100 | 0ms | 1244kb | C++ | 460b | 2022-08-06 22:39:37 | 2022-08-06 22:39:39 |
answer
#include<iostream>
#include<string>
#include<stdio.h>
using namespace std;
string doStr(string s) {
if (s[0] >= 'a' && s[0] <= 'z') {
s[0] = s[0] - ('a' - 'A');
}
for ( int i = 1; i < s.size(); i++) {
if (s[i] >= 'A' && s[i] <= 'Z') {
s[i] = s[i] + ('a' - 'A');
}
}
return s;
}
int main(void) {
int n;
string s;
cin>>n;
getchar();
for(int i=0;i<n;i++){
getline(cin,s);
cout<<doStr(s)<<endl;
}
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 20
Accepted
time: 0ms
memory: 1240kb
input:
7 weisen-U 10-JAN-2019 CSV import uSes mxGraph beta-5
output:
Weisen-u 10-jan-2019 Csv Import Uses Mxgraph Beta-5
result:
ok 7 lines
Test #2:
score: 20
Accepted
time: 0ms
memory: 1244kb
input:
4 AspiRiN Cisapride 2-PENICILLIN Cefradine-6
output:
Aspirin Cisapride 2-penicillin Cefradine-6
result:
ok 4 lines
Test #3:
score: 20
Accepted
time: 0ms
memory: 1244kb
input:
2 z_CLI140 runCLI
output:
Z_cli140 Runcli
result:
ok 2 lines
Test #4:
score: 20
Accepted
time: 0ms
memory: 1240kb
input:
8 FDA approves first generic version of Sabril epilepsy
output:
Fda Approves First Generic Version Of Sabril Epilepsy
result:
ok 8 lines
Test #5:
score: 20
Accepted
time: 0ms
memory: 1240kb
input:
9 azithro-myCIN Metformin benazepril methylphenidate betameth4asone brimonidine metoprolol Bupro2pio...
output:
Azithro-mycin Metformin Benazepril Methylphenidate Betameth4asone Brimonidine Metoprolol Bupro2pion ...
result:
ok 9 lines