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.
const fi='dulieu.txt';
fo='ketqua.txt';
var f1,f2:text;
a,b:array[1..100]of integer;
n,i:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
n:=0;
while not eof(f1) do
begin
n:=n+1;
readln(f1,a[n],b[n]);
end;
for i:=1 to n do
begin
if (a[i]<b[i]) then writeln(f2,a[i])
else writeln(f2,b[i]);
end;
close(f1);
close(f2);
end.
const fi='tong.inp';
fo='tong.out';
var f1,f2:text;
a:array[1..100]of integer;
n,i,t:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,n);
for i:=1 to n do
read(f1,a[i]);
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln(f2,t);
close(f1);
close(f2);
end.
uses crt;
const fi='dulieu.txt';
var f1:text;
a:array[1..100]of real;
t:real;
i,n:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
readln(f1,n);
for i:=1 to n do readln(f1,a[i]);
t:=0;
for i:=1 to n do t:=t+a[i];
writeln(t);
close(f1);
readln;
end.
uses crt;
const fi='dayso.inp',
var a:array[1..100]of integer;
i,n:integer;
f1:text;
begin
clrscr;
assign(f1,fi); reset(f1);
readln(f1,n);
for i:=1 to n do readln(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[1000],i,n,j;
bool kt;
int main()
{
freopen("nguyento.inp","r",stdin);
freopen("nguyento.out","w",stdout);
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
if (a[i]>1)
{
kt=true;
for (j=2; j*j<=a[i]; j++)
if (a[i]%j==0) kt=false;
if (kt==true) cout<<a[i]<<" ";
}
return 0;
}
Uses crt;
Const fi='dl.int';
Var f1:text;
A:array[1..100] of integer;
I,n,t: integer;
Begin
Clrscr;
Assign(f1,fi); reset(f1);
Readln(f1,n);
For i:=1 to n do
Read(f1,a[i]);
T:=0;
For i:=1 to n do
T:=t+a[i];
Writeln(t);
Close(f1);
Readln;
End.