UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#170527#1146. 整理药名luojianwei22161000ms1248kbC++426b2023-05-23 22:22:482023-05-23 22:22:50

answer

#include <bits/stdc++.h>
using namespace std;
string s[2147];
int main() {
	int n;
	cin >> n;
	for(int i = 0; i < n; i++) cin >> s[i];
	for(int i = 0; i < n; i++) {
		int len = s[i].size();
		if(s[i][0] >= 'a' && s[i][0] <= 'z') s[i][0] -= 32;
		for(int j = 1; j < len; j++) {
			if(s[i][j] >= 'A' && s[i][j] <= 'Z') s[i][j] += 32;
		}
	}
	for(int i = 0; i < n; i++) {
		cout << s[i] << endl;
	}
	return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 20
Accepted
time: 0ms
memory: 1244kb

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: 1248kb

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: 1244kb

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: 1244kb

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