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.
Dưới đây là một vài câu hỏi có thể liên quan tới câu hỏi mà bạn gửi lên. Có thể trong đó có câu trả lời mà bạn cần!
![](https://rs.olm.vn/images/avt/0.png?1311)
AP
25 tháng 7 2021
uses crt;
var s:string;
i,tong,x,code:integer;
f,g:text;
k:boolean;
const fi='XAU.INP';
fo='XAU.OUT';
begin
k:=false;
assign(f,fi); reset(f);
assign(g,fo); rewrite(g);
readln(f,s);
tong:=0;
for i:=1 to length(s) do
begin
if s[i] in ['0'..'9'] then
begin
k:=true;
val(s[i],x,code);
tong:=tong+x;
x:=0;
cod:=0;
end;
end;
if k=false then writeln(g,'Sai yeu cau')
else
begin
writeln(g,s);
writeln(g,tong);
end;
close(f);
close(g);
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
22 tháng 2 2022
#include <bits/stdc++.h>
using namespace std;
string st;
int d,i;
int main()
{
getline(cin,st);
d=st.length();
for (i=0; i<=d-1; i++)
if (48<=st[i] && st[i]<=57) st.erase(i,1);
cout<<st;
return 0;
}
program XoaSoLienTuc;
uses sysutils;
function XoaSoLienTuc(S: string): string;
var
i: integer;
result: string;
begin
result := '';
for i := 1 to Length(S) do
begin
if not (S[i] in ['0'..'9']) then
begin
if (i = 1) or (S[i-1] in ['0'..'9']) then
result := result + ' ';
result := result + S[i];
end;
end;
result := Trim(result);
result := StringReplace(result, ' ', '', [rfReplaceAll]);
XoaSoLienTuc := result;
end;
var
S: string;
begin
write('Nhập vào xâu S: ');
readln(S);
writeln('Kết quả: ', XoaSoLienTuc(S));
end.
không ra bạn ơi