QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#93902#4413. Cyber LanguageTobo#AC ✓3ms3328kbC++11585b2023-04-03 19:40:142023-04-03 19:40:18

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-03 19:40:18]
  • Judged
  • Verdict: AC
  • Time: 3ms
  • Memory: 3328kb
  • [2023-04-03 19:40:14]
  • Submitted

answer

#include <bits/stdc++.h>
#define N 200005
using i64 = long long;
using namespace std;
void solve(){
int t;
    cin >> t;
    getchar();
string st;
    while(t --){
        getline(cin,st);
       string ans;
        for(int i= 0; i < st.size(); i++){
            if(i == 0) ans += char(st[i] -'a' + 'A');
            else if(st[i - 1] ==' ') ans += char(st[i] -'a' + 'A');
        }
        cout <<ans << endl;
        st.clear();
    }
}
signed main()
{
    // ios::sync_with_stdio(false);
    // cin.tie(0);
    // cout.tie(0);
    solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 3328kb

input:

10
qing lian xi wo
bao gao
wo dai ni men da
da shi suo qu
bao dao
yong yuan de shen
xiao si wo le
shi zhen de
ni shuo de dou dui
yin yang guai qi

output:

QLXW
BG
WDNMD
DSSQ
BD
YYDS
XSWL
SZD
NSDDD
YYGQ

result:

ok 10 lines