K
Khách

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='so.inp';

var f1:text;

a,b:integer;

begin

clrscr;

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

while not eof(f1) do 

 begin

readln(f1,a,b);

writeln((a+b)/2:4:2);

end;

close(f1);

readln;

end.

#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;
}

 

13 tháng 3 2022

nhờ viết thành pascal hộ nhé

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

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

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

cin>>a>>b;

cout<<a*b;

return 0;

}

14 tháng 4 2022

Program HOC24;

var f1,f2: text;

a,b: integer;

t: longint;

begin

assign(f1,'input.pas');

reset(f1);

assign(f2,'output.pas');

rewrite(f2);

readln(f1,a,b);

t:=a*b;

write(f2,t);

close(f1);

close(f2);

End.

const fi='hcn.inp';     

fo='hcn.out';

var f1,f2:text;   

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

i,j,n:integer;

begin

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

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

n:=0;

while not eof(f1) do 

begin     

inc(n);     

readln(f1,a[n],b[n]); 

end;

for i:=1 to n do 

writeln(f2,2*(a[i]+b[i]),' ',a[i]*b[i]);

close(f1);

close(f2);

end.

const fi='hcn.inp';     

fo='hcn.out';

var f1,f2:text;   

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

i,j,n:integer;

begin

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

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

n:=0;

while not eof(f1) do 

begin     

inc(n);     

readln(f1,a[n],b[n]); 

end;

for i:=1 to n do 

writeln(f2,2*(a[i]+b[i]),' ',a[i]*b[i]);

close(f1);

close(f2);

end.

#include <bits/stdc++.h>

using namespace std;

string st;

int d,i,dem;

int main()

{

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

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

cin>>st;

d=st.length();

dem=0;

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

if (st[i]=='a') dem++;

cout<<dem;

return 0;

}