[技术问答] C语言截取字符串

[复制链接]
 楼主| mollylawrence 发表于 2025-5-27 09:38 | 显示全部楼层 |阅读模式
  1. #include<stdio.h>
  2. void test4()
  3. {
  4.     char arr[100];
  5.     int k = 0;
  6.     while (scanf("%s", arr) != EOF)
  7.     {
  8.         scanf("%d", &k);
  9.         arr[k] = '#include<stdio.h>
  10. void test4()
  11. {
  12.     char arr[100];
  13.     int k = 0;
  14.     while (scanf("%s", arr) != EOF)
  15.     {
  16.         scanf("%d", &k);
  17.         arr[k] = '\0';
  18.         printf("%s\n", arr);
  19.     }
  20. }
  21. int main()
  22. {
  23.     //test1();
  24.     //test2();
  25.     //test3();
  26.     test4();
  27.     return 0;
  28. }';
  29.         printf("%s\n", arr);
  30.     }
  31. }

  32. int main()
  33. {
  34.     //test1();
  35.     //test2();
  36.     //test3();
  37.     test4();
  38.     return 0;
  39. }


您需要登录后才可以回帖 登录 | 注册

本版积分规则

46

主题

1947

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部