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.

#include <bits/stdc++.h>

using namespace std;

double b,c;

int main()

{

cin>>b>>c;

if ((b==0) and (c==0)) cout<<"Vo so nghiem";

else if ((b==0) and (c!=0)) cout<<"Vo nghiem";

else cout<<fixed<<setprecision(2)<<-c/b;

return 0;

}

#include <bits/stdc++.h>

using namespace std;

double b,c;

int main()

{

cin>>b>>c;

if ((b==0) and (c==0)) cout<<"Vo so nghiem";

else if ((b==0) and (c!=0)) cout<<"Vo nghiem";

else cout<<fixed<<setprecision(2)<<-c/b;

return 0;

}

#include <bits/stdc++.h>

using namespace std;

double b,c;

int main()

{

cin>>b>>c;

if ((b==0) and (c==0)) cout<<"Vo so nghiem";

else if ((b==0) and (c!=0)) cout<<"Vo nghiem";

else cout<<fixed<<setprecision(2)<<-c/b;

return 0;

}

2:

#include <bits/stdc++.h>

using namespace std;

int main()

{

int n,i,kt=0;

cin>>n;

for (int i=2; i*i<=n; i++)

if (n%i==0) kt=1;

if (kt==0) cout<<"YES";

else cout<<"NO";

}

23 tháng 2 2023

Bài 1

Var s,i:integer;

tb:real;

Begin

Write('Nhap n = ');readln(n);

i:=1;

s:=0;

While i<=n do

Begin

s:=s+i;

i:=i+1;

End;

tb:=s/n;

Writeln('Tong la ',s);

Write('Trung binh la ',tb:10:2);

Readln;

End.

23 tháng 2 2023

Bài 2

Var i,n,souoc:integer;

Begin

Write('Nhap n = ');readln(n);

i:=1;

While i <= n do

Begin

i:=i + 1;

If n mod i = 0 then souoc:=souoc + 1;

End;

If souoc = 1 then write(n,' la so nguyen to')

Else write(n,' khong la so nguyen to');

Readln;

End.

Bài 1:

uses crt;

var n,i,s:integer;

begin

clrscr;

write('Nhap n='); readln(n);

s:=0;

for i:=1 to n do 

 if i mod 6=0 then s:=s+i;

writeln(s);

readln;

end.

Bài 2: 

uses crt;

var a,b,c,ucln,i:integer;

begin

clrscr;

write('a='); readln(a);

write('b='); readln(b);

write('c='); readln(c);

while a<>b do 

  begin

if a>b then a:=a-b

else b:=b-a;

end;

ucln:=a;

while ucln<>c do 

 begin

if ucln>c then ucln:=ucln-c

else c:=c-ucln;

end;

writeln(ucln);

readln;

end.

1:

#include <bits/stdc++.h>

using namespace std;

long long x;

int main()

{

cin>>x;

if (x%5==0) cout<<"Yes";

else cout<<"No";

return 0;

}

2: 

#include <bits/stdc++.h>

using namespace std;

long long x;

int main()

{

cin>>x;

if (x%15==0) cout<<"Yes";

else cout<<"No";

return 0;

}

17 tháng 4 2021

program tim_uoc;

uses crt;

var n,i,j:longint;

begin

clrscr;

write('nhap so n:');readln(n);

write('cac uoc cua n la:');

for i:=1 to n do

if n mod i=0 then write(i:3);

writeln;

j:=0;

for i:=1 to n do

if n mod i=0 then j:=j+1;

if j=2 then writeln(n,' la so nguyen to')

else writeln(n,' khong phai la so nguyen to');

readln;

end.

11 tháng 11 2021

uses crt;

var a:int64;

begin

clrscr;

readln(a);

if a mod 2=0 then writeln('la so chan')

else writeln('la so le');

readln;

end.