viet chuong trinh nhap vao so mguyen n va day so gom n la so nguyen tu ban phim in ra man hinh so lon nhat trong day so nguyen vua nhap
Viet chuong trinh nhap vao 1 mang be hon 20 phan tu
a/ sap xep mang theo thu tu lon dAN
b/ gia tri trung binh cua cac phan tu
c/ in ra phan tu lon nhat va phan tu nho nhat
D/ IN Ra cac phan tu la so chan
cau 1: viet ct nhap 10 so nguyen tu ban phim ,cho biet so lon nhat (nho nhat) trong cac so do
cau 2:viet ct nhap 20 so nguyen tu ban phim ,tinh tong cac le trong so do
Minh co 3 de thi thuc hanh ne . minh hoc ko gioi mon nay lam ban nao bt giup minh voi:
1, Viet chuong trinh nhap 2 so la chieu dai va chieu rong cua hinh chu nhat.tinh chu vi va dien tich .sau do in ra man hinh chu vi va dien tich cua hinh chu nhat do
2,Viet chuong trinh nhap ban kinh cua duong tron sau do tinh dien tich cua duong tron do. in kq cua dien tich h tron do ra man hinh
3, Viet cong thuc nhap lai 2 so a va b . sau do tinh tong,hieu,tich,thuong cua 2 so do . In kq ra man hinh
tinh tong cac phan so
-du lieu dau vao la file tong.inp gom 1 dong duy nhat chua cac cap so nguyen duong tuong ung voi cac cap tu so, mau so (mau khac 0) cua cac phan so
- du lieu ra la file tong.out 2 so nguyen ghi tren 1 dong tuong ung la tu so va mau so cua phan so ket qua da toi gian
vd:
1 2 2 4 3 8 11 8
1 3 5 6 3 4 2 6 9 4
viet chuong trinh nhap 1 so nguyen khac khong tu ban phim,viet ra man hinh cac so tu nhien chan
minh co bai nay:
, Viet chuong trinh nhap 2 so la chieu dai va chieu rong cua hinh chu nhat.tinh chu vi va dien tich .sau do in ra man hinh chu vi va dien tich cua hinh chu nhat do
sau khi viet ct xong va in ra man hinh thi no cho ket qua lai la:
dt hinh chu nhat la 0.0000000000E+00
chu vi hinh chu nhat la 0.0000000000E+00
co minh bao tim hieu va sua lai nhung minh ko hieu no nhu the nao
ban nao giup minh sua lai cai kq ra so nguyen voi huhuhu
viet CT nhap 1 so nguyen n khac 0 tu ban phim,viet ra man hinh tat ca cac uoc cua n