Submission #2176672
Source Code Expand
#include <bits/stdc++.h> using namespace std; char str[12]; int main() { scanf("%s", str); int n = strlen(str); int f; for(int i = 0;i < n;i++){ if('a' <= str[i] && str[i] <= 'z')f = 0; else f = 1; if(i == 0 && f == 1)printf("%c", str[i]); if(i == 0 && f == 0)printf("%c", 'A'+(str[i]-'a')); if(i > 0 && f == 1)printf("%c", 'a'+(str[i]-'A')); if(i > 0 && f == 0)printf("%c", str[i]); } printf("\n"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - 名前の確認 |
User | Ryoga_0212 |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 451 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:6:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%s", str); ^
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | sample_01.txt, sample_02.txt, test_AzielehadfJD.txt, test_Oq.txt, test_P.txt, test_Wi.txt, test_ZNEFzealEAkD.txt, test_aAZaz.txt, test_z.txt, test_zDkElDjNVmAq.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
test_AzielehadfJD.txt | AC | 1 ms | 256 KB |
test_Oq.txt | AC | 1 ms | 256 KB |
test_P.txt | AC | 1 ms | 256 KB |
test_Wi.txt | AC | 1 ms | 256 KB |
test_ZNEFzealEAkD.txt | AC | 1 ms | 256 KB |
test_aAZaz.txt | AC | 1 ms | 256 KB |
test_z.txt | AC | 1 ms | 256 KB |
test_zDkElDjNVmAq.txt | AC | 1 ms | 256 KB |