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 a,b:longint;
Begin
clrscr;
Writeln('Nhap a,b=');
Readln(a,b);
writeln('tich hai so la : a*b=',a*b);
writeln('thuong hai so la :a/b=',a/b);
Readln;
End.
#include <bits/stdc++.h>
using namespace std;
string n;
int d;
int main()
{
cin>>n;
d=n.length();
cout<<d;
return 0;
}
uses crt;
var a:array[1..100]of integer;
i,n,t1,t2,t3:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
t1:=0;
t2:=0;
t3:=0;
for i:=1 to n do
begin
if a[i] mod 2=0 then t1:=t1+a[i]
else t2:=t2+a[i];
if (a[i] mod 2=0) and (a[i] mod 3=0) then t3:=t3+a[i];
end;
writeln(t1);
writeln(t2);
writeln(t3);
readln;
end.
1.
var n: integer;
begin
repeat
write('Nhap so n: '); readln(n);
until (n>=10) and (99>=n);
writeln('Chu so hang chuc la: ', n div 10);
writeln('Chu so hang don vi la: ', n mod 10);
end.
2.
var n,i: integer;
s: string;
begin
repeat
write('Nhap so n: '); readln(n);
until (n>=100) and (999>=n);
write('So moi la: ');
str(n,s);
for i:=length(s) downto 1 do write(s[i]);
end.
uses crt;
var a:array[1..15]of integer;
n:integer;
begin
clrscr;
n:=1;
a[1]:=3;
repeat
n:=n+2;
a[n]:=a[n-1]+3;
until a[n]>40;
for i:=1 to n-1 do
write(a[i]:4);
readln;
end.
Var n,sc,sl,i:longint;
Begin
Write('N = ');readln(n);
Write('Cac so tu 1 den ',n,' la ');
For i:=1 to n do
Write(i:8);
Writeln;
For i:=1 to n do
Begin
If i mod 2 = 0 then sc:=sc+i
Else sl:=sl+i;
End;
Writeln('Tong cac so chan la ',sc);
Write('Tong cac so le la ',sl);
Readln
End.
Bài 2:
uses crt;
var s,a:integer;
begin
clrscr;
s:=0;
a:=0;
repeat
a:=a+1;
s:=s+a;
until s>500;
writeln(s);
readln;
end.
uses crt;
var a,b,c:integer;
begin
clrscr;
for a:=1 to 9 do
for b:=0 to 9 do
for c:=0 to 9 do
if (a+b+c=a*b*c) then writeln(a,b,c,' ');
readln;
end.
đúng ko vậy bn