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 b,c;
int main()
{
cin>>b>>c;
if ((b==0) and (c==0)) cout<<"Vo so nghiem";
else if ((b==0) and (c!=0)) cout<<"Vo nghiem";
else cout<<fixed<<setprecision(2)<<-c/b;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
double b,c;
int main()
{
cin>>b>>c;
if ((b==0) and (c==0)) cout<<"Vo so nghiem";
else if ((b==0) and (c!=0)) cout<<"Vo nghiem";
else cout<<fixed<<setprecision(2)<<-c/b;
return 0;
}
Câu 1:
uses crt;
var a,b:integer;
begin
clrscr;
readln(a,b);
write(a+b);
readln;
end.
Câu 2:
uses crt;
var a,b,c:integer;
begin
clrscr;
readln(a,b,c);
writeln(a+b-c);
readln;
end.
Câu 3:
uses crt;
var a,b:integer;
begin
clrscr;
readln(a,b);
writeln(a-b);
readln;
end.
Câu 4:
uses crt;
var x,y,z:integer;
begin
clrscr;
readln(x,y,z);
writeln((x+y)*z);
readln;
end.
program tim_chu_so;
uses crt;
var i,n,csln:longint;
k:integer;
a:array[1..1000]of longint;
st:string;
begin
clrscr;
write('nhap so n:');readln(n);
str(n,st);
val(st,a[i]);
csln:=a[1];
for i:=1 to length(st) do
if csln<a[i] then csln:=a[i];
writeln('chu so lon nhat cua so ',n,' la:',csln);
readln;
end.
Câu 1:
uses crt;
var n,i,d,x,y,max:integer;
st:string;
begin
clrscr;
write('Nhap n='); readln(n);
str(n,st);
d:=length(st);
max:=0;
for i:=1 to d do
begin
val(st[i],x,y);
if max<x then max:=x;
end;
writeln('Chu so lon nhat la: ',max);
readln;
end.
{PROGRAM Bai_tap1;
USES crt;
VAR n, i, C, L:Bytbe;
BEGIN
clrscr;
Write('Nhap n:');Readln(n);
C:=0;L:=0;
For i:=1 to n do
If i mod 2=0 then C:=C+i else L:=L+i;
writeln('Tong cac so chan la:',C);
writeln ('Tong cac so le la:',L);
Readln;
end.
}
Bài 1:
uses crt;
var a:array[1..100]of integer;
i,n,min:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
min:=a[1];
for i:=1 to n do
if min>a[i] then min:=a[i];
writeln(min);
readln;
end.
Bài 2:
uses crt;
var a:array[1..100]of integer;
i,n,max:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln(max);
readln;
end.
C1:
khai báo:
program hieu_a_va_b ("tự đặt tên cái này ko cần thiết)
uses crt;
var a, b : integer
phần thân:
begin
writeln ("nhap so a"); read(a);
writeln ("nhap so b"); read(b);
writeln ("hieu cua hai so la: a - b=" , a - b);
end.
C2:
khai báo:
program tinh_ba_so
uses crt;
var a, b, c : integer
phần thân:
begin
writeln ("nhap so a"); read(a);
writeln ("nhap so b"); read(b);
writeln ("nhap so c"); read(c);
writeln ("ket qua cua phep tinh a+b-c la" , a+b-c);
end.
C3:
khai báo:
program tinh_ba_so
uses crt;
var x, y, z : integer
phần thân:
begin
writeln ("nhap so x"); read(x);
writeln ("nhap so y"); read(y);
writeln ("nhap so z"); read(z);
writeln ("ket qua cua phep tinh (x+y)*z la") , (x+y)*z);
end.
nhớ chạy thử chương trình nha. xem có lỗi ko.
(nhớ tick cho mk nha)
Câu 2:
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
cout<<a-b;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
double b,c;
int main()
{
cin>>b>>c;
if ((b==0) and (c==0)) cout<<"Vo so nghiem";
else if ((b==0) and (c!=0)) cout<<"Vo nghiem";
else cout<<fixed<<setprecision(2)<<-c/b;
return 0;
}