K
Khách

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.

16 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

long long a,b,c;

bool kt;

int main()

{

cin>>a>>b>>c;

kt=false;

if (a==(b+c)/2) kt=true;

if (b==(a+c)/2) kt=true;

if (c==(b+a)/2) kt=true;

if (kt==false) cout<<"Khong lap duoc";

else cout<<"Lap duoc";

return 0;

}

uses crt;

var x,n,d,i:longint;

st,st1:string;

a:integer;

{----------------------chuong-trinh-con-tim-ucln---------------------}

function ucln(a,b:longint):longint;

var t:longint;

begin

   t:=b mod a;

   while t<>0 do

     begin

        t:=a mod b;

        a:=b;

        b:=t;

     end;

  ucln := a;

end;

{-------------------chuong-trinh-chinh-----------------}

begin

clrscr;

write('nhap x='); readln(x);

str(x,st);

d:=length(st);

st1:='';

for i:=d downto 1 do

  st1:=st1+st[i];

val(st1,n,a);

if ucln(x,n)=1 then writeln('Phai')

else writeln('khong phai');

readln;

end.

23 tháng 10 2021

undefined

10 tháng 11 2021

k p python đâu pascal nha mà tôi làm được rồi

19 tháng 12 2021

#include <bits/stdc++.h>

using namespace std;

long long a,b,c;

int main()

{

cin>>a>>b>>c;

if (a+c %2==0) cout<<"AC ";

if (b+c%2==0) cout<<"BC ";

if (a+b%2==0) cout<<"AB";

return 0;

}

19 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

long n,i,dem,t;

int main()

{

cin>>n;

dem=0;

t=0;

for (i=1; i<=n;i++)

if (n%i==0) 

{

dem++;

t=t+i;

}

cout<<dem<<" "<<t;

return 0;

}

17 tháng 9 2021

câu 1

Program Nguyen_to;

Var n,i:integer;

Function NT(n:integer):Boolean;

Var ok: Boolean;

i: integer;

Begin ok:=true;

for i:=2 to n-1 do if (n mod i)= 0 then ok:=ok and false;

if n < 2 then NT:=false else NT:=ok;

End;

Begin Write('Nhap n: ');

Readln(n); i:=n;

Repeat i:=i+1;

Until NT(i);

Write('So nguyen to nho nhat lon hon ',n, 'la: ',i);

Readln End.

17 tháng 9 2021

câu 2

uses crt;

const so: set of char=['0','1','2','3','4','5','6','7','8','9'];

var a:array[1..100] of integer;

st,b:string;

c,l,i,n,j:integer;

s, Max: integer;

begin clrscr;

write('Nhap xau:');

readln(st);

l:=length(st);

i:=1;

n:=0;

repeat if (st[i] in so) then begin b:='';

repeat b:=b+st[i];

inc(i);

until (not(st[i] in so)) or (i>l);

inc(n);

val(b,a[n],c);

end;

inc(i);

until i>l;

Max:=a[1];

for i:=2 to n do If Max<A[i] Then Max:=A[i];

Writeln('Phan tu lon nhat cua mang:', Max);

readln;

end.

#include <iostream>
using namespace std;
int main()
{
    int n,i,j;
    cout<<"Nhap n="; cin>>n;
    for (i=1; i<=n; i++)
    {
        for (j=i; j<=i+n-1; j++)
            cout<<j<<" ";
        cout<<endl;
    }
    return 0;
}

 

8 tháng 9 2021

#include <iostream>
using namespace std;
int main()
{
    int n,i,j;
    cout<<"Nhap n="; cin>>n;
    for (i=1; i<=n; i++)
    {
        for (j=i; j<=i+n-1; j++)
            cout<<j<<" ";
        cout<<endl;
    }
    return 0;
}

8 tháng 9 2021

#include <iostream>
using namespace std;
int main()
{
    int t,m,n,ucln;
    cout<<"Nhap n="; cin>>n;
    cout<<"Nhap m="; cin>>m;
    t=m%n;
    while (t!=0)
    {
        t=n%m;
        n=m;
        m=t;
    }
    ucln=n;
    cout<<ucln;
    return 0;
}

#include <iostream>
using namespace std;
int main()
{
    int t,m,n,ucln;
    cout<<"Nhap n="; cin>>n;
    cout<<"Nhap m="; cin>>m;
    t=m%n;
    while (t!=0)
    {
        t=n%m;
        n=m;
        m=t;
    }
    ucln=n;
    cout<<ucln;
    return 0;
}