Báo cáo thực hành - ngôn ngữ lập trình
- Pages
- 24
- Format
- Taille
- 326 KB
- Langue
- VI · Tiếng Việt
- Vues
- 538
- Commentaires
- 0
- Lượt tải
- 0
Génération de l'aperçu...
- Nom du document
- Báo cáo thực hành - ngôn ngữ lập trình
- Table des matières
- Ce document n'a pas de table des matières claire.
- Pages
- 24 pages
- Téléversé par
- ThiNganHang
Un résumé détaillé est en cours de génération. Veuillez vérifier dans quelques 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/
Foire aux questions
Comment puis-je télécharger ce document ?
Le document « Báo cáo thực hành - ngôn ngữ lập trình » coûte 10 000đ. Rechargez votre portefeuille via PayOS, puis cliquez sur Télécharger pour acheter et enregistrer le fichier original.
Combien de pages compte ce document ?
Le document contient 24 pages. Vous pouvez le prévisualiser en ligne avant de le télécharger.
Puis-je prévisualiser avant de télécharger ?
Oui. Vous pouvez prévisualiser ce document directement sur cette page avec le lecteur en ligne (les premières pages), puis décider de le télécharger ou non.
Báo cáo thực hành - ngôn ngữ lập trình
Génération de l'aperçu...
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/
- Nom du document
- Báo cáo thực hành - ngôn ngữ lập trình
- Table des matières
- Ce document n'a pas de table des matières claire.
- Pages
- 24 pages
- Téléversé par
- ThiNganHang
Un résumé détaillé est en cours de génération. Veuillez vérifier dans quelques minutes.
Commentaires (0)
Aucun commentaire pour le moment. Soyez le premier !
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

Commentaires (0)
Aucun commentaire pour le moment. Soyez le premier !