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.
uses crt;
const fi='input.txt';
fo='output.txt';
var f1,f2:text;
a,b:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,a,b);
if (a=0) and (b=0) then writeln(f2,'Phuong trinh co vo so nghiem');
if (a<>0) then writeln(f2,-b/a:4:2);
if (a=0) and (b<>0) then writeln(f2,'Phuong trinh vo nghiem');
close(f1);
close(f2);
end.
const fi='dulieu.inp';
fo='kq.inp';
var f1,f2:text;
a,b,c,delta:real;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,a,b,c);
delta:=sqr(b)-4*a*c;
if delta<0 then writeln(f2,'Phuong trinh vo nghiem');
if delta=0 then writeln(f2,'Phuong trinh co nghiem kep la: ',-b/(2*a):4:2);
if delta>0 then
begin
writeln(f2,'Nghiem thu nhat la: ',(-b+sqrt(delta))/(2*a):4:2);
writeln(f2,'Nghiem thu hai la: ',(-b-sqrt(delta))/(2*a):4:2);
end;
close(f1);
close(f2);
end.
const fi='input.inp';
fo='output.out';
var a,b:integer;
f1,f2:text;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,a,b);
if a<b then writeln(f2,a)
else writeln(f2,b);
close(f1);
close(f2);
end.
uses crt;
const fi='so.txt';
var f1:text;
a:array[1..100]of integer;
n,i:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
readln(f1,n);
for i:=1 to n do
read(f1,a[i]);
for i:=1 to n do
write(a[i]:4);
close(f1);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
freopen("sn.inp","r",stdin);
freopen("cn.out","w",stdout);
cin>>a>>b;
cout<<a*b;
return 0;
}
const fi='input.txt';
fo='output.txt';
var f1,f2:text;
a:array[1..100]of integer;
i,n,t:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
n:=0;
while not eof(f1) do
begin
inc(n);
read(f1,a[n]);
end;
t:=0;
for i:=1 to n do t:=t+a[i];
write(f2,t);
close(f1);
close(f2);
end.
uses crt;
const fi='dulieu.dat';
var f1:text;
a,b,p,s:array[1..100]of real;
i,n:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
n:=0;
while not eof(f1) do
begin
n:=n+1;
readln(a[n],b[n]);
end;
for i:=1 to n do
begin
p[i]:=(a[i]+b[i])/2;
s[i]:=a[i]*b[i];
end;
for i:=1 to n do
writeln(p[i]:4:2,' ',s[i]:4:2);
close(f1);
readln;
end.
Program hotrotinhoc_hoc24;
const fi='thamso.dat';
fo='nghiem.dat';
var a,b: integer;
x: real;
procedure ip;
begin
assign(f,fi);
reset(f);
readln(f,a,b);
close(f);
end;
procedure out;
begin
assign(f,fo);
rewrite(f);
x:=0-b;
x:=x/a;
write(f,'x=',x:1:0);
close(f);
end;
begin
ip;
out;
end.