1 solutions

  • 0
    @ 2025-11-5 15:21:06

    C :

    #include <stdio.h>
    #include <stdlib.h>
    #define swap(a,b) t=a;a=b;b=t;
    int main(int argc, char *argv[])
    {
      int a,b,t;
      scanf("%d%d",&a,&b);
      swap(a,b);
      printf("%d %d",a,b);
    
      return 0;
    }
    
    

    C++ :

    #include<iostream>
    using namespace std;
    int main()
    {
    int a,b;
    cin>>a>>b;
    cout<<b<<" "<<a<<endl;
    }
    

    Pascal :

    var a,b:integer;
    begin
      readln(a,b);
      write(b,' ',a);
    end.
    
    • 1

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

    Information

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