Những câu hỏi liên quan
Khoi Tran
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 4 2021 lúc 20:53

Câu 1: 

uses crt;

const fi='nguon.txt'

var f1:text;

a,b,c:integer;

begin

clrscr;

write('a='); readln(a);

write('b='); readln(b);

write('c='); readln(c);

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

writeln(f1,a);

writeln(f1,b);

writeln(f1,c);

close(f1);

readln;

end.

Nguyễn Lê Phước Thịnh
20 tháng 4 2021 lúc 20:56

Câu 2: 

const fi='nguon.txt'

fo='kq.txt'

var f1,f2:text;

a,b,c,max,min:integer;

begin

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

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

readln(f1,a);

readln(f1,b);

readln(f1,c);

writeln(f2,(a+b+c)/3:4:2);

max:=a;

if max<b then max:=b;

if max<c then max:=c;

writeln(f2,max);

min:=a;

if min>b then min:=b;

if min>c then min:=c;

writeln(f2,min);

close(f1);

close(f2);

end.

Duyen Pham
Xem chi tiết
Nguyễn Lê Phước Thịnh
22 tháng 3 2021 lúc 21:23

const fi='input.txt'

fo='output.txt'

var f1,f2:text;

a,b:integer;

begin

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

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

readln(f1,a,b);

writeln(f2,a+b);

close(f1);

close(f2);

end.

TÌNH ĐIÊN DẠI
Xem chi tiết
hoichut
Xem chi tiết
32. Xuân Thanh-7a5
Xem chi tiết
Đặng Phạm Thành Nhật
Xem chi tiết
Đặng Phạm Thành Nhật
28 tháng 9 2021 lúc 16:27

mình ghi dư cái số 4 bên phần BAI7.INP nha mn

 

Lala
Xem chi tiết
Trương Huy Hoàng
13 tháng 12 2023 lúc 22:58

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
map<ll,ll> mp;
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    freopen("MAP1.INP","r",stdin);
    freopen("MAP1.OUT","w",stdout);
    ll n; cin >> n;
    ll a[n+5];
    for(ll i=1;i<=n;i++) cin >> a[i], mp[a[i]]++;
    for(pair<ll,ll> it:mp) cout << it.first << " " << it.second << "\n";
}

Chúc bạn học tốt!

Phạm Nhật
Xem chi tiết
gấu béo
26 tháng 3 2023 lúc 22:27

program TimSoDoiXung;

var

     f_in, f_out: text;

     n, num, tmp, rem: integer;

begin

     // mở file đầu vào

     assign(f_in, 'sdx.inp');

     reset(f_in);

     // mở file đầu ra

     assign(f_out, 'sdx.out');

     rewrite(f_out);

     // đọc n từ file đầu vào

     readln(f_in, n);

     // tìm các số đối xứng

     for num := 1 to n do

     begin

          tmp := num;

          rem := 0;

          while tmp <> 0 do

          begin

               rem := rem * 10 + tmp mod 10;

               tmp := tmp div 10;

          end;

          if num = rem then

               writeln(f_out, num);

     end;

     // đóng file đầu vào và đầu ra

     close(f_in);

     close(f_out);

end.

Phat NotFound
Xem chi tiết
Nguyễn Đăng Nhân
25 tháng 8 2023 lúc 21:41

Mình sử dụng ngôn ngữ c++:

#include <bits/stdc++.h>

using namespace std;
long long a[5];
int main()
{
    for(int i=1;i<=4;i++){
        cin>>a[i];
    }
    sort(a+1,a+5);
    cout<<a[1];
    return 0;
}