Usa boy need help

The swapThree () function swaps three integers a, b, c to b, c, a. Immediately after calling this function, variable a has the value of variable b, b has the value of c, and c has the value of a.
You need to write swapThree () so that main () runs through tests.

Input Description
1 22 3
Output Description
22 3
Last edited on
void swapThree(int &a, int &b, int &c0)//
int t = a;//
a = b;//
b = t;//
int d = b;//
b = c;//
b = d;//
}
ko duoc rin oiiii :(
cout sai rin oi

cout ra 22 1 3 :(
thoi toi fix duoc roi
phai la

void swapThree(int &a, int &b, int &c){
int t = a;
a = b;
b = t;
int d = b;
b = c;
c = d;
}
viet voi qa viet nham
viet lai ho bai 2 100/100 voi
bai struct 4

struct Student{
string name;
double math, physics, chemistry;
Student(string _name){
name = _name;
}
void setMarks(double a, double b, double c){
math = a;
physics = b;
chemistry = c;

}
string getName(){
return name;
}
double getAverage(){
return (math + physics + chemistry) / 3;
}
};
i'm sure the forum would appreciate if you guys can restrict your public correspondence to English. thanks
okay bro
number 2

#include <iostream>//
#include <cmath>//
using namespace std;//

int main(){//
int n;//
cin >> n;//
int a[n];//
for(int i = 0; i < n; i++){//
cin >> a[i];
}
int min = abs(a[0] - a[1]);
for(int i = 0; i < n - 1; i++){
for(int j = i + 1; j < n; j++){
if( abs(a[i] - a[j]) < min )
min = abs( a[i] - a[j] );
}
}
cout << min;
}
Topic archived. No new replies allowed.