9306번 - Practice: Roll Call
"Both the first and last name will be less than 20 characters long."
위 문장은 20자 미만으로 해석되지만,
실패 코드:
```cpp
#include<cstdio>int T;char s[20], t[20]; // 여기서 실패, s[21], t[21]로는 통과int main() { scanf("%d", &T); for (int i = 1; i <= T; i++) { scanf(" %[^\n] %[^\n]", s, t); printf("Case %d: %s, %s\n", i, t, s); }}
```
https://www.acmicpc.net/source...
assert로 검증해보니 20이하인게 맞는 것 같습니다!
댓글을 작성하려면 로그인해야 합니다.
sillysillyman 1년 전
"Both the first and last name will be less than 20 characters long."
위 문장은 20자 미만으로 해석되지만,
실패 코드:
```cpp
#include<cstdio>
int T;
char s[20], t[20]; // 여기서 실패, s[21], t[21]로는 통과
int main() {
scanf("%d", &T);
for (int i = 1; i <= T; i++) {
scanf(" %[^\n] %[^\n]", s, t);
printf("Case %d: %s, %s\n", i, t, s);
}
}
```