1 条题解

  • 0
    @ 2025-12-5 16:55:34

    C :

    
    #define CHANGE(a,b,t) t=a;a=b;b=t;  
    main()  
    {int c,d,s;  
    scanf("%d%d",&c,&d);  
    CHANGE(c,d,s);  
    printf("%d %d",c,d);  
    }
    

    C++ :

    #include <iostream>
    //#include <stdio.h>
    //#include <conio.h>
    #include <string>
    //#include <math.h>
    using namespace std;
    
    int main()
    {
    	int a,b;
    	cin >> b >> a;
    	cout << a << " " << b;
    	//_getch();
    	return 0;
    }
    
    

    Java :

    import java.util.Scanner;
    
    public class Main {
    
    	/**
    	 * @param args
    	 */
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		Scanner input = new Scanner(System.in);
    		int a = input.nextInt();
    		int b = input.nextInt();
    		a = a + b;
    		b = a - b;
    		a = a - b;
    		System.out.println(a + " " + b);
    		
    	}
    
    }
    
    

    Python :

    a = map(lambda x:int(x), raw_input().split())
    
    print a[1],a[0]
    
    • 1

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

    信息

    ID
    2020
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    (无)
    递交数
    0
    已通过
    0
    上传者