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.
2/ program bt;
var N,i:integer;
begin
write('nhap so N'); readln(N);
writeln;
writeln (' bang nhan ', N);
writeln;
for i:=1 to 10 do writeln(N,'x',1:2,'= ', N*1;3); end
readln
end.
Mik chỉ bít làm bài 2 thôi!
program loc_so_le;
uses crt;
var N,y: longint;
begin
Writeln('Nhap so N '); Readln(N);
for y:=1 to N do if (y mod 2) <>0 then Writeln (y,' la so le');
Readln;
end.
Uses Crt;
Var A : Array [1..100] Of Integer ;
i , j , n , T : Integer ;
BEGIN
Clrscr ;
Write(' Do dai cua day so N = ') ; Readln (N) ;
Writeln (' Nhap day so : ') ;
For i := 1 To N Do
Begin
Write('A[', i ,'] = ') ; Readln ( A ) ;
End ;
i := 1 ;
While (i <= n-1) Do
Begin
j := i+1;
While j<=n do
Begin
If A[j] < A then
Begin
T := A[j];
A[j ] := A;
A := T ;
End ;
j := j + 1;
End ;
i := i + 1;
End ;
Writeln(' Day sau khi sap xep : ') ;
For i := 1 To N Do Write(A : 4) ;
Readln ;
END .
Program tính_chia;
Uses crt;
Var i, n, s, a: integer;
Begin
Write('Nhap so n: '); readln(n);
s:=1;
For i:=1 to n do s:=s*i;
a:=0;
For i:=1 to n do a:=a+i;
Writeln('Ket qua phep tinh chia bang: ', s/a :10:2);
readln;
End.
refer
uses crt;
var i,n:longint;
a:array[1..100] of real;
s1,s,max,min:real;
begin
clrscr;
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('Diem trung binh mon tin hoc cua ban thu ',i,' la: ');readln(a[i]);
end;
min:=a[1];max:=a[1];
for i:=2 to n do begin
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i]; end;
for i:=1 to n do
s:=s+a[i];
s1:=s/n;
writeln('So diem cao nhat la: ',max);
writeln('So diem thap nhat la: ',min);
write('Diem TB cua ca lop la: ',s1:0:1);
readln
#include <bits/stdc++.h>
using namespace std;
double a[100],t;
int n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
cout<<"Diem cua ban thu "<<i<<" la: "<<fixed<<setprecision(2)<<a[i]<<endl;
t=0;
for (i=1; i<=n; i++) t+=a[i];
cout<<"Trung binh cua lop la: "<<fixed<<setprecision(2)<<t/(n*1.0);
return 0;
}