Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
Bài 2:
#include <bits/stdc++.h>
using namespace std;
double x,y,z;
int main()
{
cin>>x>>y>>z;
cout<<max(x,max(y,z));
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ifstream fin("MATKHAU.INP");
ofstream fout("MATKHAU.OUT");
vector<string> matkhau;
string line;
while (getline(fin, line)) {
if (line.empty()) continue;
stringstream ss(line);
vector<long long> a;
long long x;
while (ss >> x) {
a.push_back(x);
}
int m = a.size();
long long cnt = 0;
// Đếm số bộ 3 thỏa mãn
for (int i = 0; i < m; i++) {
for (int j = i + 1; j < m; j++) {
for (int k = j + 1; k < m; k++) {
long long sum = a[i] + a[j] + a[k];
long long prod = a[i] * a[j] * a[k];
if (sum != 0 && prod % sum == 0)
cnt++;
}
}
}
matkhau.push_back(to_string(cnt));
}
// Ghi mật khẩu (viết liền)
for (string &s : matkhau)
fout << s;
fin.close();
fout.close();
return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
cout << n * (n - 1) / 2;
return 0;
}