Những câu hỏi liên quan
APOK FF
Xem chi tiết
Lê Chiêu Nguyên	Vũ
Xem chi tiết
Ngọc Hồng
Xem chi tiết
Nguyễn Lê Phước Thịnh
17 tháng 3 2022 lúc 14:48

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

freopen("sn.inp","r",stdin);

freopen("cn.out","w",stdout);

cin>>a>>b;

cout<<a*b;

return 0;

}

Bình luận (0)
Trang
Xem chi tiết
phạm tú
Xem chi tiết
Nguyễn Lê Phước Thịnh
9 tháng 3 2023 lúc 14:29

#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;

}

Bình luận (0)
Nguyễn Thanh
Xem chi tiết
Nguyễn Lê Phước Thịnh
6 tháng 2 2021 lúc 22:05

const fi='hcn.inp'     

fo='hcn.out'

var f1,f2:text;   

a,b:array[1..100]of integer;   

i,j,n:integer;

begin

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

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

n:=0;

while not eof(f1) do 

begin     

inc(n);     

readln(f1,a[n],b[n]); 

end;

for i:=1 to n do 

writeln(f2,2*(a[i]+b[i]),' ',a[i]*b[i]);

close(f1);

close(f2);

end.

Bình luận (0)
Đỗ Huyền
Xem chi tiết
Nguyễn Lê Phước Thịnh
9 tháng 2 2021 lúc 13:32

const fi='hcn.inp'     

fo='hcn.out'

var f1,f2:text;   

a,b:array[1..100]of integer;   

i,j,n:integer;

begin

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

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

n:=0;

while not eof(f1) do 

begin     

inc(n);     

readln(f1,a[n],b[n]); 

end;

for i:=1 to n do 

writeln(f2,2*(a[i]+b[i]),' ',a[i]*b[i]);

close(f1);

close(f2);

end.

Bình luận (0)
Dung Từ
Xem chi tiết
Nguyễn Lê Phước Thịnh
24 tháng 1 2022 lúc 21:40

#include <bits/stdc++.h>
using namespace std;
long long a,b;
//chuongtrinhcon
long long gcd(long long a,long long b)
{
    if (b==0) return(a);
    return gcd(b,a%b);
}
//chuongtrinhchinh
int main()
{

freopen("songuyen.inp","r",stdin);
cin>>a>>b;
cout<<gcd(a,b);
return 0;
}

 

Bình luận (1)
Văn Hữu
Xem chi tiết
datcoder
19 tháng 12 2023 lúc 19:54

Program HOC24;

var s: string;

i,x: byte;

begin

readln(s);

//-----------Câu a

while s[1]=#32 do delete(s,1,1);

while s[length(s)]=#32 do delete(s,length(s),1);

while pos(#32#32,s)<>0 do delete(s,pos(#32#32,1);

writeln(s);

//-------------Câu b

s[1]:=upcase(s[1]);

for i:=1 to length(s) do

if s[i]=#32 upcase(s[i+1]);

writeln(s);

//--------------Câu c

for i:=1 to length(s) do

if s[i]=#32 then x:=i;

for i:=x+1 to length(s) do

write(s[i]);

//---------------------------

readln

end.

Bình luận (0)
Long ca ca
Xem chi tiết
Phía sau một cô gái
30 tháng 6 2023 lúc 20:10

program superSymmetricalSubstring;

var

      s: string;

function isSymmetrical(str: string): boolean;

var

      i, len: integer;

begin

      len := length(str);

      for i := 1 to len div 2 do

      begin

            if str[i] <> str[len - i + 1] then

            begin

                  exit(false);

            end;

      end;

      exit(true);

end;

function countSuperSymmetricalSubstrings(s: string): integer;

var

      i, j, len, count: integer;

begin

      len := length(s);

      count := 0;

      for i := 1 to len do

      begin

            for j := 2 to len - i + 1 do

            begin

                  if isSymmetrical(copy(s, i, j)) then

                  begin

                        count := count + 1;

                  end;

            end;

      end;

      count := count + len;

      exit(count);

end;

begin

      write('Nhap xau S: ');

      readln(s);

      writeln('So xau con sieu doi xung cua S: ', countSuperSymmetricalSubstrings(s));

      readln;

end.

Bình luận (1)