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.
#include <bits/stdc++.h>
using namespace std;
double a,b;
int main()
{
freopen("ab.inp","r",stdin);
freopen("ab.out","w",stdout);
cin>>a>>b;
cout<<fixed<<setprecision(1)<<a+b<<endl;
cout<<fixed<<setprecision(1)<<a-b;
return 0;
}
a, b = map(int, input().split())
c = int(input())
result = ((a % c) * (b % c)) % c
print(result)
var a,b: real;
begin
write('Nhap a,b: '); readln(a,b);
if a < b then writeln(a:5:2) else if a > b then writeln(b:5:2) else writeln('Khong co');
end.
uses crt;
var a,b:real;
begin
clrscr;
repeat
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
until a<>b;
if a<b then writeln('So nho nhat la: ',a:4:2)
else writeln('So nho nhat la: ',b:4:2);
readln;
end.
#include <iostream>
using namespace std;
int main() {
long long a, b, c;
cin >> a >> b >> c;
long long result = ((a % c) + (b % c)) % c;
cout << result << endl;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
double a,b,t,h,s,thuong;
int main()
{
cin>>a>>b;
t=a+b;
h=a-b;
s=a*b;
thuong=a/b;
cout<<fixed<<setprecision(2)<<t<<endl;
cout<<fixed<<setprecision(2)<<h<<endl;
cout<<fixed<<setprecision(2)<<s<<endl;
cout<<fixed<<setprecision(2)<<thuong;
return 0;
}
Bài 4:
#include <bits/stdc++.h>
using namespace std;
long long a[1000],i,n;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
sort(a+1,a+n+1);
cout<<"So lon nhat la: "<<a[n]<<endl;
cout<<"So nho nhat la: "<<a[1]<<endl;
cout<<"So lon thu hai la: "<<a[n-1]<<endl;
cout<<"So nho thu hai la: "<<a[2];
return 0;
}
Bài 2:
uses crt;
var n,i,t:integer;
begin
clrscr;
readln(n);
t:=0;
for i:=1 to n do
if (i mod 3=0) and (i mod 5=0) then t:=t+i;
writeln(t);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long x,y;
int main()
{
cin>>x>>y;
freopen("kq.txt","w",stdout);
cout<<x+y<<endl;
cout<<x-y<<endl;
cout<<x*y<<endl;
cout<<fixed<<setprecision(2)<<(x*1.0)/(y*1.0);
return 0;
}
#include <bits/stdc++.h>
using namespace std;
double a,b;
int main()
{
cin>>a>>b;
cout<<fixed<<setprecision(2)<<a+b<<endl;
cout<<fixed<<setprecision(2)<<a-b;
return 0;
}