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,n,t,j,kt:integer;
begin
clrscr;
readln(n);
t:=0;
for i:=2 to n do
if n mod i=0 then
begin
kt:=0;
for j:=2 to trunc(sqrt(i)) do
if i mod j=0 then kt:=1;
if kt=0 then t:=t+i;
end;
write(t);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long a,b;
char st;
int main()
{
cin>>a>>b;
cout<<"Nhap phep tinh:"; cin>>st;
if (st=='+') cout<<a+b;
if (st=='-') cout<<a-b;
if (st=='*') cout<<a*b;
if (st=='/') cout<<a/b;
return 0;
}
Program HOC24;
var a,b,c,max: integer;
begin
readln(a,b,c);
max=a;
if max>b then max=b;
if max>c then max=c;
write('So lon nhat trong 3 so la: ',max);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
int main () { int a[1000],n,i;
cin >> n;
for (int i=1;i<=n;i++)
cin >> a[i];
for (int i=2;i<=n;i++)
if (((a[i]<0) and (a[i-1]<0)) or ((a[i]>0) and (a[i-1]>0))) {
cout << a[i-1] <<" " << a[i];
break; }
return 0;
}
program hoidaptinhoc;
uses crt;
var K,N,X,Y,M,i : longint;
z : string;
BEGIN
clrscr;
writeln('Nhap so dong trong moi trang cua quyen sach: '); readln(K);
writeln('Nhap so thu tu cua dong: '); readln(N);
if (N mod K) = 0 then begin X:=N div K; Y:=K end;
if (N mod K) <> 0 then begin X:= (N div K) + 1; Y:=N mod K end;
M:=0;
for i:=1 to X do
begin
str(i,z);
M:=M+length(z);
end;
writeln('X= ',X,' Y= ',Y);
writeln('M= ',M);
readln;
END.
Program HOC24;
const fi='Cau1.INP';
fo='Cau2.OUT';
var i,a,b,c,t,d: integer;
f: text;
function ucln(x,y: integer): integer;
var t: integer;
begin
while y<>0 do
begin
t:= x mod y;
x:=y;
y:=t;
end;
ucln:=x;
end;
procedure ip;
begin
assign(f,fi);
reset(f);
read(f,a,b,c);
close(f);
end;
procedure out;
begin
assign(f,fo);
rewrite(f);
for i:=b to c do
begin
if i mod a=0 then write(f,i,' ');
t:=t+i;
end;
writeln(f);
while t<>0 do
begin
t:=t div 10;
inc(d);
end;
writeln(f,d);
if ucln(a,b,c)=1 then write(f,1) else write(f,0);
close(f);
end;
begin
ip;
out;
end.
C++:
#include <iostream>
Using namespace std;
Int main(){
Cin>>n;
Cout<<endl;
Cout<<3*n<<endl;
Return 0;
}
Viết chương trình Pascal à bạn?