Những câu hỏi liên quan
Lương Ngọc Anh
Xem chi tiết
Phía sau một cô gái
31 tháng 3 2023 lúc 20:25

Câu 1:

ho_ten = input("Nhập họ tên: ")

tach_ho_ten = ho_ten.split()

if len(tach_ho_ten) > 1:

     ten = tach_ho_ten[-1]

     print("Tên của bạn là:", ten)

else:

     print("Nhập sai định dạng họ tên")

Câu 2: 

s = input("Nhập xâu: ")

hoa = s.upper()

print(hoa)

Bình luận (0)
Lê Đăng Khôi
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 2 2023 lúc 15:39

1:

uses crt;

var t,x,i,n:integer;

begin

clrscr;

t:=0;

n:=10;

for i:=1 to n do

begin

readln(x);

t:=t+x;

end;

write(t);

readln;

end.

2: 

uses crt;

var dem,x,i,n:integer;

begin

clrscr;

dem:=0;

n:=10;

for i:=1 to n do

begin

readln(x);

if x mod 2=0 then inc(dem);

end;

write(dem);

readln;

end.

Bình luận (1)
Lê Chiêu Nguyên	Vũ
4 tháng 4 2023 lúc 10:18

3

program Cacsole;
uses crt;
var M, N, i: integer;
begin
clrscr;
write ('Nhap M= '); readln(M);
write ('Nhap N= '); readln(N);
for i := M to N do

if  i mod 2 = 1 then
write (i,' ');
readln;
end.

Bình luận (1)
Selena Flynn
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 3 2022 lúc 23:03

c1: 

#include <bits/stdc++.h>

using namespace std;

long long i,n,s;

int main()

{

cin>>n;

s=1;

for (i=1; i<=n; i++) s=s*i;

cout<<s;

return 0;

}

Câu 2: 

#include <bits/stdc++.h>

using namespace std;

long long i,n,s;

int main()

{

cin>>n;

s=1;

for (i=1; i<=n; i++) if (i%2==0) s=s*i;

cout<<s;

return 0;

}

Bình luận (0)
lợi Lưu
Xem chi tiết
Yết Thiên
Xem chi tiết
Trúc Giang
12 tháng 5 2021 lúc 9:55

Câu 2:

Program nii;

Uses crt;

Var a,b,c,A:integer;

Begin

Write ('nhap a');

Readln (a);

Write ('nhap b');

Readln (b);

Write ('nhap c');

Readln (c);

A:=a;

If A<b then A:=b;

If A<c then A:=c;

Write ('Ket qua',A);

Readln;

End.

Bình luận (0)
Trúc Giang
12 tháng 5 2021 lúc 9:51

Câu 1

Program ntg;

Uses crt;

Var A,x,y:integer;

Begin

Write ('nhap x');

Readln (x);

Write ('nhap y');

Readln ('y');

A:=x+y;

Write ('Ket qua',A);

Readln;

End.

 

Bình luận (0)
Nguyễn Lê Phước Thịnh
12 tháng 5 2021 lúc 18:43

Câu 2: 

uses crt;

var a,b,c,max:integer;

begin

clrscr;

write('Nhap a='); readln(a);

write('Nhap b='); readln(b);

write('Nhap c='); readln(c);

max:=a;

if max<b then max:=b;

if max<c then max:=c;

writeln('So lon nhat trong 3 so la: ',max);

readln;

end.

Bình luận (1)
trịnh mai châm
Xem chi tiết
Kiều Vũ Linh
17 tháng 5 2022 lúc 18:17

Begin

Write('Di mot ngay dang hoc mot sang khon');

Readln;

End.

Bình luận (0)
nuinuini
Xem chi tiết
Nguyễn Lê Phước Thịnh
11 tháng 10 2021 lúc 0:31

2: 

#include <bits/stdc++.h>

using namespace std;

int main()

{

string st;

int a;

cin>>st;

cin>>a;

cout<<"Xin chao "<<st<<endl;

cout<<"Nam nay "<<st<<" "<<2021-a<<" tuoi";

return 0;

}

Bình luận (0)
Huy Phạm
Xem chi tiết
Kiều Vũ Linh
3 tháng 5 2023 lúc 6:12

1)

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

i,n,t:integer;

Begin

Write('n = ');readln(n);

For i:=1 to n do

Begin

Write('Nhap so thu ',i,' = ');readln(a[i]);

End;

For i:=1 to n do

If a[i] > a[i+1] then

Begin

t:=a[i];

a[i]:=a[i+1];

a[i+1]:=t;

End;

Write('Sap xep tang dan ');

For i:=1 to n do write(a[i]:8);

Readln

End.

Bình luận (0)
Kiều Vũ Linh
3 tháng 5 2023 lúc 6:13

2)

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

i,n,t:integer;

Begin

Write('n = ');readln(n);

For i:=1 to n do

Begin

Write('Nhap so thu ',i,' = ');readln(a[i]);

End;

For i:=1 to n do

If a[i] < a[i+1] then

Begin

t:=a[i];

a[i]:=a[i+1];

a[i+1]:=t;

End;

Write('Sap xep giam dan ');

For i:=1 to n do write(a[i]:8);

Readln

End.

Bình luận (0)
Huynh Uyen
Xem chi tiết
Nguyễn Hoàng Duy
5 tháng 4 2023 lúc 16:49

program DemSoDiem;
var n, i: integer;
  diem: array[1..100] of integer; // khai báo mảng điểm
  begin
  write('Nhap so luong hoc sinh: ');
  readln(n);
  // Nhập điểm cho từng học sinh
  for i := 1 to n do begin
    write('Nhap diem cua hoc sinh thu ', i, ': ');
    readln(diem[i]);
  end;
    // In ra số điểm dưới dạng Pascal
  writeln('const so_diem: array[1..', n, '] of integer = (', diem[1]);
  for i := 2 to n do begin
    write(', ', diem[i]);
  end;
  writeln(');');
end.

 

Bình luận (0)