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.
uses crt;
var i,t:integer;
begin
clrscr;
t:=0;
for i:=1 to 1000 do
if (i mod 10=5) and (i mod 2=1) then t:=t+i;
writeln(t);
readln;
end.
Program Sara_Trang;
uses crt;
Begin
Writeln('Turbo Pascal');
Readln
End.
1: uses crt;
begin
clrscr;
writeln('turbo pascal');
readln;
end.
2: uses crt;
var i:integer;
begin
clrscr;
for i:=1 to 20 do
writeln('turbo pascal');
readln;
end.
3:
uses crt;
var i:integer;
begin
clrscr;
for i:=1 to 20 do
writeln('day la dong thu ',i,' turbo pascal');
readln;
end.
4:
uses crt;
var i,n:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
writeln('turbo pacal');
readln;
end.
5:
uses crt;
var i:byte;
begin
clrscr;
for i:=1 to 100 do
write(i);
readln;
end.
6:
uses crt;
var i:byte;
begin
clrscr;
for i:=1 to 100 do
write(i:4);
readln;
end.
7:
uses crt;
var d,i:integer;
begin
clrscr;
d:=0;
for i:=1 to 100 do
begin
write(i:4);
inc(d);
if d mod 10=0 then writeln;
end;
readln;
end.
8:
uses crt;
var i:integer;
begin
clrscr;
writeln('cac so le trong khoang tu 1 toi 100 la: ');
for i:=1 to 100 do
if i mod 2=1 then write(i:4);
readln;
end.
9:
uses crt;
var d:integer;
i:longint;
begin
clrscr;
d:=0;
for i:=1 to 10000 do
begin
if i mod 2=0 then write(i:4);
inc(d);
if d mod 10=0 then
begin
writeln;
delay(1000);
end;
end;
readln;
end.
10:
uses crt;
var d:integer;
i:longint;
begin
clrscr;
d:=0;
for i:=1 to 10000 do
begin
if i mod 2=1 then write(i:4);
inc(d);
if d mod 10=0 then
begin
writeln;
delay(1000);
end;
end;
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long a[5],i;
int main()
{
for (i=1; i<=5; i++) cin>>a[i];
sort(a+1,a+5+1);
cout<<"Tong nho nhat la: "<<a[1]+a[2]+a[3]+a[4]<<endl;
cout<<"Tong lon nhat la: "<<a[5]+a[4]+a[3]+a[2];
return 0;
}
#include <iostream>
using namespace std;
int tong=0,x[1001],tongcs=0;
void xuli(int i)
{
for(int j=0;j<=9;j++)
{
if(j==0&&i==1)
continue;
x[i]=j;
tong*=10;
tong+=j;
tongcs+=j;
if(i==3)
{
if(tong%6==2&&tongcs==20)
{
cout<<tong<<endl;
}
}
else
{
xuli(i+1);
}
tongcs-=j;
tong-=j;
tong/=10;
}
}
int main()
{
xuli(1);
return 0;
}
uses crt;
var i,t,d,x,y,j:integer;
st:string;
begin
clrscr;
writeln('cac so tu nhien co 3 chu so sao cho so do chia cho 6 du 2 va tong cac chu so la 20 gom cac so:');
for i:=100 to 999 do
begin
t:=0;
str(i,st);
d:=length(st);
for j:=1 to d do
begin
val(st[j],x,y);
t:=t+x;
end;
if (i mod 6=2) and (t=20) then write(i:6);
end;
readln;
end.
#include <iostream>
int main() {
int n;
std::cout << "Nhap so tu nhien n: ";
std::cin >> n;
int sum = 0;
for (int i = 1; i <= n; i++) {
if (i % 3 == 0) {
sum += i;
}
}
std::cout << "Tong cac so tu nhien nho hon hoac bang " << n << " ma chia het cho 3 la: " << sum << std::endl;
return 0;
}
```c++
#include <iostream>
using namespace std;
int main() {
int n, sum = 0;
cout << "Nhap so nguyen duong n: ";
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 3 == 0) {
sum += i;
}
}
cout << "Tong cac so tu nhien nho hon hoac bang " << n << " ma chia het cho 3 la: " << sum;
return 0;
}
```
uses crt;
var a:array[1..100]of integer;
i,n,dem:integer;
begin
clrscr;
n:=5;
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
dem:=0;
for i:=1 to n do
if (a[i] mod 2=0) and (a[i] mod 5=0) then inc(dem);
writeln(dem);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
int main (){
int t1=0,t2=0;
for (int i=1;i<1000;i++){
if (i%5==4) t1=t1+i;
if (i%6==5) t2=t2+i;
}
cout << "Tong cac so chia 5 du 4 la: " << t1 << endl;
cout << "Tong cac so chia 6 du 5 la: " << t2;
return 0;
}