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.
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.
#include <bits/stdc++.h>
using namespace std;
long long n,i,x;
//chuongtrinhcon
bool ktnt(long long x)
{
if (x<2) return false;
for (int i=2; i*i<=x; i++)
if (x%i==0) return(false);
return true;
}
//chuongtrinhchinh
int main()
{
freopen("dl.dat","r",stdin);
freopen("kq.dat","w",stdout);
cin>>n;
dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (ktnt(x)) dem++;
}
cout<<dem;
return 0;
}
const fi='input.inp';
fo='output.out';
var a,b:integer;
f1,f2:text;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,a,b);
if a<b then writeln(f2,a)
else writeln(f2,b);
close(f1);
close(f2);
end.
#include <bits/stdc++.h>
using namespace std;
long long a,b;
double tb;
int main()
{
freopen("dulieu.inp","r",stdin);
freopen("ketqua.out","w",stdout);
cin>>a>>b;
cout<<a<<" "<<b;
cout<<fixed<<setprecision(2)<<(a*1.0+b*1.0)/(2*1.0);
return 0;
}
const fi='input.txt';
fo='output.txt';
var f1,f2:text;
a,b,c,max:real;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,a,b,c);
min:=a;
if min>b then min:=b;
if min>c then min:=c;
writeln(f2,min);
close(f1);
close(f2);
end.
const fi='songuyen.inp';
fo='tong.out';
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 eoln(f1) do
begin
n:=n+1;
read(f1,a[n]);
end;
t:=0;
for i:=1 to n do
if a[i] mod 2=0 then t:=t+a[i];
writeln(f2,t);
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.
Program HOC24;
const fi='cau2.inp';
fo='cau2.out';
var dt,a,b,c: integer;
procedure ip;
begin
assign(f,fi);
reset(f);
viết bằng c++ ạ