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
datcoder
Giáo viên
8 tháng 12 2023

Program HOC24;

var i: byte;

s: string;

begin

readln(s);

for i:=1 to length(s) do

begin

if s[i]='1' then write('mot ');

if s[i]='2' then write('hai ');

if s[i]='3' then write('ba ');

if s[i]='4' then write('bon ');

if s[i]='5' then write('nam ');

if s[i]='6' then write('sau ');

if s[i]='7' then write('bay ');

if s[i]='8' then write('tam ');

if s[i]='9' then write('chin ');

if s[i]='0' then write('khong ');

readln;

end.

D
datcoder
Giáo viên
3 tháng 2

#include <bits/stdc++.h>

using namespace std;

int main(){

    int n;

    for (int i=1; i<=10; i++)

         cout << n <<" x " << i <<" = "<<n*i;

    return 0;

}

12 tháng 10 2021

Mình dùng C++ nên div = /; mod = % nha bn!

#include <bits/stdc++.h>
using namespace std;
int main() {
int a, S;
cin >> a;
S=0;
while(a>0)
{
    S+=a%10, a=a/10;
}
cout << S << endl;
return 0;
}

Chúc bn học tốt!

13 tháng 10 2021

em cảm ơn ạ

 

25 tháng 3 2022

var st:string;

i,dem:integer;

begin

write('Nhap xau ki tu: ');readln(st);

for i:=1 to length(st) do

if st[i]=' ' then dem:=dem+1;

write('so ki tu la dau cach la ',dem);

readln;

end.

1:

uses crt;

var a:array[1..100]of integer;

i,n,t:integer;

begin

clrscr;

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

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

t:=0;

for i:=1 to n do 

  if a[i] mod 2<>0 then t:=t+a[i];

writeln(t);

readln;

end.

3:

const fi='dl.txt';

fo='kq.txt';

var f1,f2:text;

a:integer;

begin

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

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

readln(f1,a);

writeln(f2,a);

close(f1);

close(f2);

end.

Bài 2: 

#include <bits/stdc++.h>;

using namespace std;

int main();

{

long m,n;

cout<<"Nhap m="; cin>>m;

cout<<"Nhap n="; cin>>n;

cout<<m*n-2;

return 0;

}

uses crt;

var n,i,dem,j,t:integer;

kt:boolean;

begin

clrscr;

readln(n);

t:=0;

for i:=2 to n do 

begin

kt:=true;

for j:=2 to i-1 do 

  if i mod j=0 then kt:=false;

if kt=true then 

begin

write(i:4);

t:=t+i;

end;

end;

writeln;

writeln(t);

readln;

end.

18 tháng 3 2023

Uses crt;

var n,i,x,u: integer;

begin clrscr;

readln(n);

for i:=1 to n do begin

readln(x);

u:=u+x;

end;

writeln(u);

readln;

end.

25 tháng 12 2023

program TongCacSoNguyen;

var
  N, i, soNguyen, tong: integer;

begin
  // Nhập số lượng N
  write('Nhap so luong N: ');
  readln(N);

  // Khởi tạo tổng
  tong := 0;

  // Nhập và tính tổng các số nguyên
  for i := 1 to N do
  begin
    write('Nhap so nguyen thu ', i, ': ');
    readln(soNguyen);
    tong := tong + soNguyen;
  end;

  // In ra màn hình tổng
  writeln('Tong cua cac so nguyen la: ', tong);

  readln;
end.