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.

20 tháng 2 2022

#include <bits/stdc++.h>

using namespace std;

string a[1000],t,ln;

int n,i;

int main()

{

cin>>n;

for (i=1;i<=n; i++) cin>>a[i];

ln='';

for (i=1; i<=n; i++) if (ln<a[i]) ln=a[i];

t='';

for (i=1; i<=n; i++) t=t+a[i];

cout<<ln<<" "<<t;

return 0;

}

21 tháng 2 2022

có chương trình bằng pascal không ạ

21 tháng 2 2022

zời zăm ba cái program:>

21 tháng 2 2022

PROGRAM XAU;

USES crt;

VAR N1 ; N2 : String;

          a ; i :Bytbe;

BEGIN

     clrscr;

     write(' Nhap xau N1:') ; Readln(N1);

     N2:='  ';

     for i:=1 to Length(N1) do

        If ( 'a'<=N1

moa cai dau doi ty qua kia lam 

14 tháng 6 2021

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.

 

9 tháng 3 2023

#include <bits/stdc++.h>

using namespace std;

int main()

{

string st;

int d,i,dem=0;

getline(cin,st);

d=st.length();

for (int i=0; i<d; i++)

if (st[i]=' ') dem++;

cout<<dem+1;

return 0;

}

26 tháng 2 2022

uses crt;

var s1,s2:string;

i,j,d1,d2:integer;

begin

clrscr;

readln(s1,s2);

d1:=length(s1);

d2:=length(s2);

for i:=1 to d1 do 

  if not(s1[i] in ['0'..'9']) then delete(s1,i,1);

for i:=1 to d2 do 

  if not(s2[i] in ['0'..'9']) then delete(s2,i,1);

writeln(s1);

writeln(s2);

writeln(s1+s2);

readln;

end.

8 tháng 10 2023

uses crt;

var s1,s2:string;

begin

clrscr;

readln(s1,s2);

writeln(s1+s2);

writeln(length(s1+s2));

readln;

end.