Báo cáo thực hành - ngôn ngữ lập trình
- Pages
- 24
- Format
- Size
- 326 KB
- Language
- VI · Tiếng Việt
- Views
- 538
- Comments
- 0
- Lượt tải
- 0
Generating preview...
- Document name
- Báo cáo thực hành - ngôn ngữ lập trình
- Table of contents
- This document has no clear table of contents.
- Pages
- 24 pages
- Uploaded by
- ThiNganHang
A detailed summary is being generated. Please check back in a few minutes.
Description
Trích nội dung tài liệu
1 TRƯỜNG ĐẠI HỌC BÁCH KHOA Viện Điện tử - Viễn Thông BÁO CÁO THỰC HÀNH NGÔN NGỮLẬP TRÌNH Họ và tên: Nguyễn Đình Tâm Lớp: ĐT-TT 07 – K57 MSSV: 20122381 Hà Nội, 04/2014 https://fb.com/ 2 Program 1.1 #include <iostream> using namespace std; void main() { char a; cout<<"nhap mot ki tu\t"; cin>> a; cout<<"Ki tu la "<< a <<"\nMa ASSI la "<<dec<< (int)a<<"\n"; cout<< hex << "He co so 16 la 0x" << (int)a << "\n"; cout<<oct<<"He co so 8 la 0"<<(int)a << "\n"; system("pause"); } Program 1.2 #include <iostream> using namespace std; void main() { double f,C,pi; pi=3.14159; cout<<"Nhap f="; cin>> f; cout<<"\n"; cout<<"Nhap C="; cin>>C; cout<<"\n"; cout<<"Xc="<<1/(2*pi*f*C); system("pause"); } Program 1.3 #include <iostream> using namespace std; void main() { double R1,R2,R3; char cach_mac[20]; cout<<"R1="; cin>>R1; cout<<"R2="; cin>>R2; cout<<"R3="; cin>>R3; cin.ignore(); cout<<"Cach mac 3 dien tro la: "; https://fb.com/ 3 cin.get(cach_mac, 20); if (strcmp(cach_mac, "noi tiep") == 0) cout<<"Rt= "<<R1+R2+R3; else cout<<"Rt= "<<(1/(1/R1+1/R2+1/R3)); system("pause"); } Program 2.1 #include <iostream> using namespace std; void main() { double R[20],Rt,Rn; inti,n; char cach_mac[20]; Rt=0; Rn=1; cout<<"so dien tro trong mach la\t"; cin>>n; for(i=1;i<=n;i++) { cout<<"R["<<i<<"]="; cin>>R[i]; Rt=Rt+R[i]; Rn=Rn*R[i]; } cin.ignore(); cout<<"Cach mac"<<i-1<<" dien tro la: "; cin.get(cach_mac, 20); if (strcmp(cach_mac, "noi tiep") == 0) cout<<"Rt= "<<Rt; else cout<<"Rt= "<<(Rn/Rt); system("pause"); } https://fb.com/
Frequently asked questions
How do I download this document?
The document “Báo cáo thực hành - ngôn ngữ lập trình” costs 10,000đ. Top up your wallet via PayOS, then click Download to purchase and save the original file.
How many pages is this document?
The document has 24 pages. You can preview it online before downloading.
Can I preview before downloading?
Yes. You can preview this document right on this page with the online reader (first few pages), then decide whether to download.
Báo cáo thực hành - ngôn ngữ lập trình
Generating preview...
Trích nội dung tài liệu
1 TRƯỜNG ĐẠI HỌC BÁCH KHOA Viện Điện tử - Viễn Thông BÁO CÁO THỰC HÀNH NGÔN NGỮLẬP TRÌNH Họ và tên: Nguyễn Đình Tâm Lớp: ĐT-TT 07 – K57 MSSV: 20122381 Hà Nội, 04/2014 https://fb.com/ 2 Program 1.1 #include <iostream> using namespace std; void main() { char a; cout<<"nhap mot ki tu\t"; cin>> a; cout<<"Ki tu la "<< a <<"\nMa ASSI la "<<dec<< (int)a<<"\n"; cout<< hex << "He co so 16 la 0x" << (int)a << "\n"; cout<<oct<<"He co so 8 la 0"<<(int)a << "\n"; system("pause"); } Program 1.2 #include <iostream> using namespace std; void main() { double f,C,pi; pi=3.14159; cout<<"Nhap f="; cin>> f; cout<<"\n"; cout<<"Nhap C="; cin>>C; cout<<"\n"; cout<<"Xc="<<1/(2*pi*f*C); system("pause"); } Program 1.3 #include <iostream> using namespace std; void main() { double R1,R2,R3; char cach_mac[20]; cout<<"R1="; cin>>R1; cout<<"R2="; cin>>R2; cout<<"R3="; cin>>R3; cin.ignore(); cout<<"Cach mac 3 dien tro la: "; https://fb.com/ 3 cin.get(cach_mac, 20); if (strcmp(cach_mac, "noi tiep") == 0) cout<<"Rt= "<<R1+R2+R3; else cout<<"Rt= "<<(1/(1/R1+1/R2+1/R3)); system("pause"); } Program 2.1 #include <iostream> using namespace std; void main() { double R[20],Rt,Rn; inti,n; char cach_mac[20]; Rt=0; Rn=1; cout<<"so dien tro trong mach la\t"; cin>>n; for(i=1;i<=n;i++) { cout<<"R["<<i<<"]="; cin>>R[i]; Rt=Rt+R[i]; Rn=Rn*R[i]; } cin.ignore(); cout<<"Cach mac"<<i-1<<" dien tro la: "; cin.get(cach_mac, 20); if (strcmp(cach_mac, "noi tiep") == 0) cout<<"Rt= "<<Rt; else cout<<"Rt= "<<(Rn/Rt); system("pause"); } https://fb.com/
- Document name
- Báo cáo thực hành - ngôn ngữ lập trình
- Table of contents
- This document has no clear table of contents.
- Pages
- 24 pages
- Uploaded by
- ThiNganHang
A detailed summary is being generated. Please check back in a few minutes.
Comments (0)
No comments yet. Be the first!
Ngân hàng đề thi môn: Hệ thống thông tin quản lý
Đề thi môn Cơ sở dữ liệu (kèm Đáp án) - Đại học Sư phạm kỹ thuật
Đề thi và đáp án môn Hệ thống thông tin kế toán
Đề thi và đáp án môn Cấu trúc dữ liệu giải thuật
Đáp án đề thi môn Mạng máy tính - ĐH Công nghệ thông tin (CNTT)
Tiểu luận - Kinh tế phát triển - Phân tích nhận định "Việt Nam đã kiên định chọn hướng phát triển lấy con người làm trọng tâm ..."
Đề cương - Luật vận tải
600 Câu trắc nghiệm Tư tưởng Hồ Chí Minh
Tài liệu ôn tập Nguyên lý kế toán
Bài tập Xác suất thống kê đại học - có lời giải

Comments (0)
No comments yet. Be the first!