K
Khách

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.

31 tháng 12 2022

#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
    float a,b,t,h,s,thuong;
    cout<<"Nhap a,b: ";
    cin>>a>>b;
    t=a+b;
    h=a-b;
    s=a*b;
    thuong=a/b;
    cout<<a<<"+"<<b<<"="<<fixed<<setprecision(2)<<t<<endl;
    cout<<a<<"-"<<b<<"="<<fixed<<setprecision(2)<<h<<endl;
    cout<<a<<"*"<<b<<"="<<fixed<<setprecision(2)<<s<<endl;
    cout<<a<<"/"<<b<<"="<<fixed<<setprecision(2)<<thuong<<endl;
return 0;
}

 

19 tháng 12 2021

#include <bits/stdc++.h>

using namespace std;

double a,b;

int main()

{

cin>>a>>b;

if (b==0) cout<<"Ko tinh duoc";

else 

{

cout<<a+b<<endl;

cout<<a-b<<endl;

cout<<a*b<<endl;

cout<<a/b;

}

return 0;

}

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

cin>>a>>b;

cout<<a+b<<endl;

cout<<a-b<<endl;

cout<<a*b<<endl;

cout<<fixed<<setprecision(1)<<(a*1.0)/(b*1.0);

return 0;

}

24 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

double a,b,c,p;

int main()

{

cin>>a>>b>>c;

p=a+b+c;

cout<<fixed<<setprecision(2)<<p;

return 0;

}

22 tháng 3 2023

program sum_of_naturals;

var
  i, n, sum: integer;

begin
  write('Enter a positive integer: ');
  readln(n);
  
  sum := 0;
  
  for i := 1 to n do
  begin
    sum := sum + i;
  end;
  
  writeln('The sum of the first ', n, ' natural numbers is ', sum);
end.

6 tháng 4 2022

lỗi r bn

24 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

double a,b,c;

int main()

{

cin>>a>>b>>c;

cout<<fixed<<setprecision(2)<<a+b+c;

return 0;

}