fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. char *a[] = {"Seoul", "Kyeonggi", "Inchon", "Daejoen", "Daegu", "Busan"};
  6. int length = sizeof(a) / sizeof(a[0]); // 배열의 길이를 계산합니다.
  7.  
  8. // 결과를 저장할 문자열 배열을 선언하고, 공백 문자로 초기화합니다.
  9. char result[10] = " ";
  10.  
  11. // 각 지역 이름의 첫 글자를 result 문자열에 누적합니다.
  12. for (int i = 0; i < length; i++) {
  13. result[i+1] = a[i][0];
  14. }
  15.  
  16. // 결과 문자열을 출력합니다.
  17. printf("%s\n", result);
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
 SKIDDB