C语言实验——交换两个整数的值(顺序结构)
Time Limit: 1000MS
Memory Limit: 65536KB
Problem Description
交换两个变量的值,由终端输入两个整数给变量x、y,然后交换x和y的值后,输出x和y。
Input
从键盘输入两个整数变量x和y;
Output
在交换x、y的值后将x和y输出!
Example Input
4 6
Example Output
6 4
Hint
Author
C:
代码:
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int x,y;
cin>>x>>y;
swap(x,y);
cout<<x<<" "<<y<<endl;
return 0;
}