1 solutions

  • 0
    @ 2025-11-5 19:24:20

    C :

    #include<stdio.h>
    int main()
    {
        char a[5];
        int i=-1;
        gets(a);
        while(a[++i]!='\0')
            printf("%c ",a[i]);
        puts("");
        return 0;
    }
    
    

    C++ :

    #include<stdio.h>
    int main()
    {
        int a,b=4,d;
        char c[4];
        scanf("%d",&a);
        while(b--)
        {
            c[b]=a%10+48;
            a=a/10;
        }
        for(b=0;b<4;b++)
            printf("%c ",c[b]);
    }
    
    

    Pascal :

    var st:string;
        i:longint;
    begin
      readln(st);
      for i:=1 to length(st) do
      write(st[i],' ');
    end.
    
    • 1

    C语言程序设计教程(第三版)课后习题8.8

    Information

    ID
    19344
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By