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.
1:
#include <bits/stdc++.h>
using namespace std;
long long a[100],i,n;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
cout<<"Day ban dau la: "<<endl;
for (i=1;i<=n; i++) cout<<a[i]<<" ";
cout<<endl;
sort(a+1,a+n+1);
cout<<"Day tang dan la: "<<endl;
for (i=1; i<=n; i++) cout<<a[i]<<" ";
return 0;
}
uses crt;
var a:array[1..100]of integer;
i,n,x,dem,kt:integer;
begin
clrscr;
write('nhap n='); readln(n);
if n=1 then a[1]:=2
else begin
a[1]:=2;
x:=1;
dem:=1;
repeat
x:=x+2;
kt:=0;
for i:=2 to trunc(sqrt(x)) do
if x mod i=0 then kt:=1;
if kt=0 then begin
inc(dem);
a[dem]:=x;
end;
until dem=n;
end;
{-----------------------------------------}
writeln(n,' so nguyen to dau tien la:');
for i:=1 to n do
write(a[i]:4);
{--------------------------}
readln;
end.
uses crt;
var n,i:longint;
kt:boolean;
begin
clrscr;
readln(n);
if (n<2) then writeln('Nhap lai')
else
begin
kt:=true;
for i:=2 to trunc(sqrt(n)) do
if n mod i=0 then
begin
kt:=false;
break;
end;
if kt=true then writeln('la so nguyen to')
else writeln('khong la so nguyen to');
end;
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.
Program HOC24;
var i,a,b: longint;
d: byte;
function t(x: longint): longint;
var j,t1: longint;
begin
t1:=0;
for j:=1 to x do if x mod j=0 then t1:=t1+j;
t:=t1;
end;
begin
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
d:=0;
for i:=a to b do
if (t(i)/i)=12/5 then d:=d+1;
write(d);
readln
end.
#include <stdio.h>
#include <math.h>
int main() {
int n,a;
printf("Nhap vao so nguyen duong: ");
scanf("%d", &n);
if(n>0)
{
a=sqrt(n);
if((a*a)==n)
printf("So ban da nhap vao la so chinh phuong");
else
printf("So ban da nhap vao ko phai la so chinh phuong");
Bạn ơi câu này là CLB đội tuyển Tin học lớp 6 đó chứ bạn viết cái gì dzậy trời
Program hotrotinhoc;
var i,n,s,k,max,n1: longint;
begin
write('Nhap N='); readln(n);
max:=0; n1:=n;
while n<>0 do
begin
k:=n mod 10;
s:=s*10+k;
n:=n div 10;
if k>max then max:=k;
end;
writeln('Chu so lon nhat cua so tu nhien vua nhap la :',max);
If s=n1 then write('La so doi xung') else write('Khong phai so doi
xung');
readln
end.
uses crt;
var n,i,d,x,ln,kt:word;
st:string;
a:array[1..100]of integer;
begin
clrscr;
write('nhap n='); readln(n);
str(n,st);
d:=length(st);
for i:=1 to d do
val(st[i],a[i],x);
ln:=0;
for i:=1 to d do
if ln<a[i] then ln:=a[i];
writeln('chu so lon nhat trong so ',n,' la: ',ln);
{-----------------------kiem-tra-doi-xung----------------------------}
kt:=0;
for i:=1 to d do
if a[i]<>a[d+1-i] then kt:=1;
if kt=0 then writeln('day la so doi xung')
else writeln('day khong la so doi xung');
readln;
end.
mình ko thấy
giúp mình đi
uses crt;
var n,i,t:int64;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until (0<n) and (n<1000000000);
t:=0;
for i:=1 to n-1 do
if n mod i=0 then t:=t+i;
if t=n then writeln(n,' la so hoan hao')
else writeln(n,' khong la so hoan hao');
readln;
end.