我怎么这么菜


私信TA

用户名:xujingcheng

访问量:16810

签 名:

Break Away

等  级
排  名 717
经  验 3755
参赛次数 4
文章发表 44
年  龄 10
在职情况 学生
学  校 NUAA
专  业

  自我简介:

毕业前学一下编程, 嗯! 是这样。

#include<stdio.h>
#include"string.h"
int main()
{
    int N,temp;
    unsigned int i;
    char str[100],c[100];
    scanf("%d",&N);
    getchar();
    if(N<=100)
    {
        temp=N;
       while(temp)
       {
        gets(str);
        puts(str);
        temp--;
        putchar('\n');
       }
       while(1)
       {
         i=0;
         gets(str);
         int j=0;
          for(;i<strlen(str);i++)
          {
              if(str[i]==' '||str[i]=='\n')
              {
                  c[j]='\0';
                  puts(c);
                  j=0;
                  putchar('\n');
              }
              else  c[j++]=str[i];
              if(i==strlen(str)-1) {c[j]='\0';puts(c);j=0;putchar('\n');}
          }
        }
       /* while(scanf("%s",str)!=EOF)
        {
            printf("%s\n",str);
            printf("\n");
            }*/

    }
    return 0;
}
 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区