Những câu hỏi liên quan
Quỳnh Như
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 5 2022 lúc 23:21

uses crt;

const fi='songuyen.inp'

fo='songuyen2.out'

var a:array[1..100]of integer;

i,n,t1:integer;

f1,f2:text;

begin

clrscr;

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

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

readln(f1,n);

for i:=1 to n do readln(f1,a[i]);

t1:=0;

for i:=1 to n do if a[i] mod 2<>0 then t1:=t1+a[i];

writeln(t1);

writeln(f2,t1);

for i:=1 to n do 

  if a[i] mod 2<>0 then write(a[i]:4);

close(f1);

close(f2);

readln;

end.

Bình luận (0)
Phạm Tiến Vượng
Xem chi tiết
Phan Thị T.Chinh
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 4 2021 lúc 12:49

uses crt;

const fi='ketqua.out'

var f1:text;

a:array[1..100]of integer;

i,n,min:integer;

begin

clrscr;

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

write('Nhap 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(f1,min);

close(f1);

readln;

end.

Bình luận (0)
Anh Thư Nguyễn
Xem chi tiết
Mei Mei
Xem chi tiết
Phan Tú
Xem chi tiết
duc tran
Xem chi tiết
Nguyên trần
Xem chi tiết
Nguyễn Lê Phước Thịnh
28 tháng 1 2022 lúc 22:40

#include <bits/stdc++.h>

using namespace std;

string n;

int d,i,t,x;

int main()

{

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

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

cin>>st;

d=st.length();

t=0;

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

{

x=int(st[i])-48;

t=t+x;

}

cout<<t;

return 0;

}

Bình luận (0)
Felix MC-Gamer
Xem chi tiết
vu viet anh
Xem chi tiết