Những câu hỏi liên quan
Nguyễn Văn Hùng
Xem chi tiết
nguyen dao
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 5 2021 lúc 21:09

const fi='vao.inp'

fo='ra.out'

var f1,f2:text;

st:string;

i,d:integer;

begin

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

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

readln(f1,st);

d:=length(st);

for i:=1 to d do 

  if st[i]='a' then delete(st,i,1);

writeln(f2,st);

close(f1);

close(f2);

end.

Bình luận (0)
LA VAN CAU
Xem chi tiết
Đào Xuân Trọng
Xem chi tiết
Phía sau một cô gái
10 tháng 5 2023 lúc 19:39

with open('XAU.INP', 'r') as input_file, open('XAU.OUT', 'w') as output_file:

        for line in input_file:

                length = len(line.strip())

                output_file.write(f'{length}\n')

Bình luận (0)
Hoài Ân 02 Lê Huỳnh
Xem chi tiết
Fax Cơ
Xem chi tiết
A3-37-Bùi Ngọc Phương Tr...
Xem chi tiết
Trần Trọng Hùng
Xem chi tiết
Nguyễn Lê Phước Thịnh
13 tháng 3 2022 lúc 11:20

#include <bits/stdc++.h>
using namespace std;
unsigned long long a[1000],i,n,uc;
//chuongtrinhcon
unsigned long long ucln(long long a,long long b)
{
    if (b==0) return(a);
    else return(ucln(b,a%b));
}
//chuongtrinhchinh
int main()
{
    freopen("sn3.inp","r",stdin);
    freopen("uc.out","w",stdout);
    cin>>n;

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

uc=ucln(a[1],a[2]);

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

uc=ucln(uc,a[i]);

cout<<uc;
    return 0;
}

 

Bình luận (1)
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)