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.
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
for (int i = 1; i <= 3; i++)
{
cin >> s;
cout << s << " ";
}
}
#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!
ta có n - k + 1 ô full k ô, k - 1 ô còn lại thì lần lượt là tổng từ 1->k - 1
Đây là đáp án đúng;
\(\left(k\times n\right)-\dfrac{\left(k-1\right)\times k}{2}\)
program xau_so_hoc;
uses crt;
procedure xu_li;
var s, x, xau : string; i, tinh, j, f1, f2 : integer;
begin
write('nhap xau: '); readln(xau);
i:=1;
repeat
x:=''; s:='';
while (xau[i] in ['0'..'9']) and (i<=length(xau)) do
begin
x:=x+xau[i];
inc(i); {tim dau '+' hoac tru '-'/tim so truoc dau do}
end;
for j:=i+1 to length(xau) do
if xau[j] in ['0'..'9'] then s:=s+xau[j] else
break;
val(x,f1); val(s,f2); {chuyen doi xau thanh so};
if xau[i]='-' then
tinh:=tinh +(f1-f2) else
if xau[i] = '+' then
tinh:=tinh + (f1+f2);
{tinh toan voi xau va dau da tim duoc}
i:=j;
until i>=length(xau);
write('xau da tinh toan: ', tinh);
end;
{chuong trinh chinh}
begin
clrscr;
xu_li;
end.
#include <bits/stdc++.h>
using namespace std;
int main() {
string str;
getline(cin, str);
string ans = "";
for (char c : str) {
if (!isdigit(c)) {
ans += c;
}
}
cout <<ans;
}
Theo mk là như v
uses crt;
var st:string;
d,i:integer;
begin
clrscr;
readln(st);
d:=length(st);
for i:=1 to d do
if not(st[i] in ['0'..'9']) then write(st[i]);
readln;
end.