SUBMISSION LINK
https://www.hackerrank.com/contests/y16csecs/challenges/swap-1-2
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
long long t,a,b,c;
scanf("%lld",&t);
while(t--)
{
scanf("%lld %lld",&a,&b);
c=b;
b=a;
a=c;
printf("%lld %lld\n",a,b);
}
return 0;
}
https://www.hackerrank.com/contests/y16csecs/challenges/swap-1-2
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
long long t,a,b,c;
scanf("%lld",&t);
while(t--)
{
scanf("%lld %lld",&a,&b);
c=b;
b=a;
a=c;
printf("%lld %lld\n",a,b);
}
return 0;
}
Comments
Post a Comment