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.
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;
}
#include <bits/stdc++.h>
using namespace std;
long long i,a,b;
int main()
{
cin>>a>>b;
for (i=1; i<=min(a,b); i++)
if ((a%i==0) and (b%i==0)) cout<<i<<" ";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a,b,bcnn;
int main()
{
cin>>a>>b;
if (a>b) swap(a,b);
bcnn=b;
while (bcnn%a!=0)
bcnn=bcnn+b;
cout<<bcnn;
return 0;
}
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.
Bạn tham khảo thử nhé
when flag clicked
ask (What is the value of a?) and wait
set [a v] to (answer)
ask (What is the value of b?) and wait
set [b v] to (answer)
set [ketqua1 v] to ((2 * (a)) - (b))
set [ketqua2 v] to ((2 * (a)) + (b))
say (ketqua1) & (ketqua2)