Những câu hỏi liên quan
cute Chanh
Xem chi tiết
Dang Hien
Xem chi tiết
Nguyễn Lê Phước Thịnh
19 tháng 12 2021 lúc 23:52

Bài 3: 

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

cin>>a>>b;

cout<<a%b;

cout<<a/b;

return 0;

}

Bình luận (0)
Dang Hien
Xem chi tiết
Nguyễn Lê Phước Thịnh
19 tháng 12 2021 lúc 23:53

2:

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

cin>>a>>b;

cout<<a%b<<endl;

cout<<a/b;

return 0;

}

Bình luận (0)
Ngáo Ngơ Alice
Xem chi tiết
nguyễn an phát
11 tháng 4 2021 lúc 12:02

program timtich;

uses  crt;

var i,n:integer;

tich:longint;

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

begin

clrscr;

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

for i:=1 to n do

begin

write('nhap phan tu a[',i,']:');readln(a[i]);

end;

for i:=1 to n do

write(a[i]:4);

tich:=1;

writeln;

for i:=1 to n do

if a[i] mod 2=0 then tich:=tich*a[i];

writeln('tich ca phan tu chan cua mang la:',tich);

readln;

end.

program timtong;

uses  crt;

var i,n:integer;

tong:longint;

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

begin

clrscr;

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

for i:=1 to n do

begin

write('nhap phan tu a[',i,']:');readln(a[i]);

end;

for i:=1 to n do

write(a[i]:4);

tong:=0;

writeln;

for i:=1 to n do

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

writeln('tong cac phan tu chan cua mang la:',tong);

tong:=0;

writeln;

for i:=1 to n do

if a[i] mod 2=1 then tong:=tong+a[i];

writeln('tong cac phan tu le cua mang la:',tong);

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
11 tháng 4 2021 lúc 17:56

Bài 1: 

uses crt;

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

i,n,s:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

s:=1;

for i:=1 to n do 

  if a[i] mod 2=0 then s:=s*a[i];

writeln(s);

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
11 tháng 4 2021 lúc 17:57

uses crt;

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

i,n,t1,t2:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

t1:=0;

t2:=0;

for i:=1 to n do

begin

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

else t2:=t2+a[i];

end;

writeln('Tong cac so chan la: ',t1);

writeln('Tong cac so le la: ',t2);

readln;

end.

Bình luận (0)
Lê thị anh thư
Xem chi tiết
Anh Nguyên
Xem chi tiết
Nguyễn Lê Phước Thịnh
19 tháng 12 2021 lúc 23:13

#include <bits/stdc++.h>

using namespace std;

double a,b;

int main()

{

cin>>a>>b;

if (b==0) cout<<"Ko tinh duoc";

else 

{

cout<<a+b<<endl;

cout<<a-b<<endl;

cout<<a*b<<endl;

cout<<a/b;

}

return 0;

}

Bình luận (0)
Trần Đăng Hải Long
Xem chi tiết
Nguyễn Lê Phước Thịnh
24 tháng 10 2021 lúc 23:33

#include <bits/stdc++.h>

using namespace std;

double a,b,c,p;

int main()

{

cin>>a>>b>>c;

p=a+b+c;

cout<<fixed<<setprecision(2)<<p;

return 0;

}

Bình luận (0)
nguyễn mạnh đoàn
Xem chi tiết
Huy Hoang Nguyen
Xem chi tiết