Những câu hỏi liên quan
Exo Aeri
Xem chi tiết
Nguyễn Lê Phước Thịnh
26 tháng 1 2022 lúc 13:12

#include <bits/stdc++.h>

using namespace std;

long long a[10],b[10],i,j;

int main()

{

freopen("input.txt","r",stdin);

freopen("output.txt","w",stdout);

for (i=1; i<=10; i++) cin>>a[i];

for (j=1; j<=10; j++) cin>>b[j];

for (i=1; i<=10; i++)

cout<<a[i]+b[i]<<" ";

return 0;

}

Bình luận (0)
Trần Văn Tiến
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 2 2022 lúc 8:41

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.

Bình luận (0)
Khánh Mỹ
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 4 2021 lúc 19:21

const fi='input.txt'

fo='output.txt'

var f1,f2:text;

st:string[125];

a:array[1..125]of string;

i,d,dem,kt,j:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(f1,st);

d:=length(st);

dem:=1;

a[1]:=st[1];

for i:=1 to d do

  begin

kt:=0;

for j:=1 to dem do 

  if a[j]=st[i] then kt:=1;

if kt=0 then 

begin

inc(dem);

a[dem]:=st[i];

end;

end;

for i:=1 to dem do 

  begin

dem1:=0;

for j:=1 to d do 

if a[i]=st[j] then inc(dem1);

writeln(f2,a[i],' xuat hien ',dem1,' lan');

end;

close(f1);

close(f2);

end.

Bình luận (0)
33. PHAN THỊ HỒNG THẮM 1...
Xem chi tiết
Yến Hoang Thị Hải
Xem chi tiết
Dania sunna
Xem chi tiết
Nguyễn Lê Phước Thịnh
19 tháng 12 2021 lúc 23:23

#include <bits/stdc++.h>

using namespace std;

long long a,b,c,d;

int main()

{

freopen("input.txt","r",stdin);

freopen("output.txt","w",stdout);

cin>>a>>b>>c>>d;

cout<<a+b+c+d;

return 0;

}

Bình luận (0)
Yến Chi Phan Nguyễn
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 3 2022 lúc 6:55

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.

Bình luận (0)
Mạnh Cường Đào Huỳnh
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 5 2022 lúc 23:55

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.

Bình luận (0)
Ngọc Hồng
Xem chi tiết
Nguyễn Lê Phước Thịnh
17 tháng 3 2022 lúc 14:48

#include <bits/stdc++.h>

using namespace std;

string st;

int d,i,dem;

int main()

{

freopen("xau.inp","r",stdin);

freopen("xau.out","w",stdout);

cin>>st;

d=st.length();

dem=0;

for (i=0; i<=d-1; i++)

if (st[i]=='a') dem++;

cout<<dem;

return 0;

}

Bình luận (0)