题解 | #字符串分隔#

字符串分隔

https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7

#include<stdio.h>
#include<string.h>
int main() {
  char string[200];
  while(scanf("%8s",string)!=EOF){
    printf("%s",string);
    int length=strlen(string);
    int n=8-length;
    for (int i=0; i<n; i++) printf("0");
    printf("\n");
  }
  return 0;
}

全部评论
ctrl+z + enter triggers EOF and then the loop ends and the program exits normally.
点赞 回复 分享
发布于 2023-11-14 17:35 广东

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务