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.

13 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

int main()

{

int i,a;

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

{

do 

{

cin>>a;

if (a%2==0) cout<<"Nhap lai";

} while (a%2!=0);

}

return 0;

}

19 tháng 10 2021

#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d, e, f, g, h, i, j;
cin >> a >> b >> c >> d >> e >> f >> g >> h >> i >> j;
if(a%2==0)
    cout << "Vui long thu lai" << endl;
else if(b%2==0)
    cout << "Vui long thu lai" << endl;
else if(c%2==0)
    cout << "Vui long thu lai" << endl;
else if(c%2==0)
    cout << "Vui long thu lai" << endl;
else if(d%2==0)
    cout << "Vui long thu lai" << endl;
else if(e%2==0)
    cout << "Vui long thu lai" << endl;
else if(f%2==0)
    cout << "Vui long thu lai" << endl;
else if(g%2==0)
    cout << "Vui long thu lai" << endl;
else if(h%2==0)
    cout << "Vui long thu lai" << endl;
else if(i%2==0)
    cout << "Vui long thu lai" << endl;
else if(j%2==0)
    cout << "Vui long thu lai" << endl;
else
    cout << a << " " << b << " " << c << " " << d << " " << e << " " << f << " " << g << " " << h << " " << i << " " << j << endl;
return 0;
}

Chúc bn học tốt! (Mk định dùng kiểu mảnh nhưng nó bị lỗi nên mk dùng cách này, nó hơi dài mong bn thông cảm!)

30 tháng 12 2021

#include <bits/stdc++.h>

using namespace std;

long long m,n,i;

int main()

{

cin>>m>>n;

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

if (i%2==1) cout<<i<<" ";

return 0;

}

28 tháng 10 2021

program vdd;

uses crt;

var i,n: integer;

begin

clrscr;

write('Nhap N: '); readln(n);

for i:=1 to n do if i mod 2=1 then write(i,';');

readln

end.

Câu 1: 

uses crt;

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

i,n:integer;

begin

clrscr;

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

for i:=1 to n do 

 begin

write('A[',i,']='); readln(a[i]);

end;

for i:=1 to n do 

  if a[i]<0 then write(a[i]:4);

readln;

end.

Câu 2: 

uses crt;

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

i,n:integer;

begin

clrscr;

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

for i:=1 to n do 

 begin

write('A[',i,']='); readln(a[i]);

end;

for i:=1 to n do 

  if a[i]>0 then write(a[i]:4);

readln;

end.

26 tháng 2 2023

Bạn bổ sung thêm đề nhé

18 tháng 12 2022

Var a:integer;
Begin
Writeln('nhap mot so nguyen: '); Readln(a);
If a mod 2 = 0 then writeln(a,' la so chan')
        else writeln(a,' la so le');
End.

11 tháng 1 2022

TK:

uses crt;
var n: longint;
begin
clrscr;
    readln(n);
    if n mod 2 = 0 then writeln('Chan') else writeln('Le');
readln;
end.

11 tháng 1 2022

#include<bits/stdc++.h>

using namespace std;

long long N;

int main()

{
cin>>N;

if(N%2==0) cout<<N<<" là số chẵn";

if(N%2!=0) cout<<N<<" là số lẻ";

}

15 tháng 11 2021

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

cin>>a>>b;

cout<<a*b<<endl;

cout<<fixed<<setprecision(2)<<(a*1.0)/(b*1.0);

return 0;

}

12 tháng 5 2021
program tinh_tong;

uses crt;

var i,n:integer;

t:longint;

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

begin

clrscr;

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

t:=0;

for i:=1 to n do

begin

write('a[',i,']=');readln(a[i]);

if a[i] mod 2=0 then t:=t+a[i];

end;

write(t);

readln;

end.