Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
duc tran
Xem chi tiết
Phạm Hồng Nguyên
Xem chi tiết
Linh
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 3 2022 lúc 23:00

#include <bits/stdc++.h>

using namespace std;

long long n,i,t;

int main()

{

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

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

cin>>n;

t=0;

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

if (i%2==0) t+=i;

cout<<t;

return 0;

}

Official LEEZ
Xem chi tiết
Minh Lệ
21 tháng 3 2023 lúc 12:16

Program HOC24;

var s: string;

i,d: byte;

f1,f2: text;

fi='Xau.mp'

fo='KQ.Out'

begin

assign(f1,fi);

assign(f2,fo);

reset(f1);

rewrite(f2);

readln(f1,s);

d:=0;

for i:=1 to length(s) do if s[i]='a' then d:=d+1;

write(f2,d);

close(f1); close(f2);

end.

huynh chinh
Xem chi tiết
Nguyễn Lê Phước Thịnh
14 tháng 4 2022 lúc 22:03

#include <bits/stdc++.h>

using namespace std;

long long n,i;

bool kt;

int main()

{

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

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

cin>>n;

kt=true;

for (i=2; i*i<=n; i++)

if (n%i==0) kt=false;

if (kt==true && n>1) cout<<"YES";

else cout<<"NO";

return 0;

}

hhnaht
Xem chi tiết
Ngạn Tuấn
Xem chi tiết
Nguyễn Lê Phước Thịnh
6 tháng 4 2020 lúc 20:57

Bài 1:

uses crt;

const fi='ketqua.txt';

var f1:text;

a,b,t:integer;

begin

clrscr;

assign(f1,fi); rewrite(f1);

write('a='); readln(a);

write('b='); readln(b);

t:=a+b;

writeln(f1,t);

close(f1);

readln;

end.

Bài 2:

uses crt;

const fi='dulieu.txt';

var f1:text;

a,b,t:integer;

begin

clrscr;

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

readln(f1,a,b);

t:=a+b;

writeln('tong cua hai so la: ',t);

close(f1);

readln;

end.

Khách vãng lai đã xóa
NguyenThiChongDinh
Xem chi tiết
Nguyễn Lê Phước Thịnh
30 tháng 4 2022 lúc 22:10

Bài 3: 

uses crt;

const fi='teptong.txt'

var a,b:integer;

f1:text;

begin

clrscr;

assign(f1,fi); rewrite(f1);

readln(a,b);

writeln(a+b);

writeln(f1,a+b);

close(f1);

readln;

end.

Trung Kiên Lưu
Xem chi tiết
Vương Hương Giang
16 tháng 1 2022 lúc 11:52

const fi='dulieu.txt'
fo='ketqua.txt'
var i,t:integer;
f1,f2:text;
a:array[1..9]of integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
t:=0;
for i:=1 to 9 do
begin
read(f1,a[i]);
t:=t+a[i];
end;
writeln(f2,t);
close(f1);
close(f2);
end.

Trung Kiên Lưu
16 tháng 1 2022 lúc 12:12

s

Nguyễn Lê Phước Thịnh
16 tháng 1 2022 lúc 13:36

const fi='dataln.txt'

fo='dataout.txt'

var f1,f2:text;

x,i,t:integer;

begin

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

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

t:=0;

for i:=1 to 24 do 

begin

read(f1,x);

t:=t+x;

end;

writeln(f2,t);

close(f1);

close(f2);

end.