Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
Tưởng Ruy Thành
Xem chi tiết
Assi Lanh
Xem chi tiết
Nguyễn Lê Phước Thịnh
13 tháng 4 2022 lúc 18:29

uses crt;

const fo='data.txt'

var f1:text;

a:array[1..10]of integer;

i,n:integer;

begin

clrscr;

assign(f1,fo); rewrite(f1);

n:=10;

for i:=1 to n do readln(a[i]);

for i:=1 to n do write(f1,a[i]:4);

close(f1);

readln;

end.

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!

An Đinh
Xem chi tiết
Minh Lệ
19 tháng 3 2023 lúc 22:52

Đề yêu cầu gì vậy bạn?

Anh Lê duy
Xem chi tiết
Anh Lê duy
Xem chi tiết
Nguyễn Lê Phước Thịnh
3 tháng 12 2021 lúc 22:52

#include <iostream>
using namespace std;
int main()
{
    int a[100][100],i,j,m,n;
    cout<<"Nhap so dong cua mang:"; cin>>n;
    cout<<"Nhap so cot cua mang:"; cin>>m;
    for (i=1; i<=n; i++)
        for (j=1; j<=m; j++)
    {
        cout<<"A["<<i<<","<<j<<"]="; cin>>a[i][j];
    }
    for (i=1; i<=n; i++)
    {
        for (j=1; j<=m; j++)
            cout<<a[i][j]<<" ";
        cout<<endl;
    }
    return 0;
}

 

Hoàng Thị Minh Tuyết
Xem chi tiết
Trâm Lê
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 2 2021 lúc 13:00

const fi='xsum1.inp'     

fo='xsum1.out'

var f1,f2:text;   

a:array[1..20000]of integer;   

i,n,j,x,dem,k,m,t:integer;

begin

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

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

readln(f1,n,x);

for i:=1 to n do 

read(f1,a[i]);

dem:=0;

for i:=1 to n do 

for j:=1 to n do   

begin       

for k:=1 to n do         

if (i<j) and (j<k) then               

begin                 

t:=0;                 

for m:=i to k do                   

t:=t+a[m];                 

if t=x then inc(dem);               

end;   

end;

for i:=1 to n do 

if x=a[i] then inc(dem);

writeln(f2,dem);

close(f1);

close(f2);

end.

Nguyễn Thái Hưng
30 tháng 6 2021 lúc 11:55

program COST;

var n,m,s,dem:int64;a:

array[1..1000000] of int64;

i,j:longint;

begin 

readln(n,m);

for i := 1 to n do read(a[i]);

dem := 0;

for i := 1 to n do

begin

s := 0;

for j := i to n do 

begin 

s := s+a[j];

if s <= m then 

begin 

inc(dem);

continue;

end

else if a[j] > m then break;

end;

end;

write(dem);

end.    

trần nguyễn tuyết trinh
Xem chi tiết
Minh Lệ
9 tháng 4 2023 lúc 18:34

Program HOC24;

var i,n: integer;

c: array[1..1000] of integer;

f: text;

begin

assign(f,'MANG3.TXT');

reset(f);

readln(f,n);

for i:=1 to n do read(f,c[i]);

close(f);

for i:=1 to n do if c[i] mod 2=1 then write(c[i],' ');

readln

end.

trần nguyễn tuyết trinh
9 tháng 4 2023 lúc 11:39

cứu e với mn