Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. ///Bai 1
  2. #include <iostream>
  3. using namespace std;
  4. int main(){
  5.     cout<<"Hello World";
  6.     return 0;
  7. }
  8. ///Bai 2
  9. #include <iostream>
  10. using namespace std;
  11. int main(){
  12.     int a,b;
  13.     cout<<"nhap vao a:";
  14.     cin>>a;
  15.     cout<<"nhap vao b:";
  16.     cin>>b;
  17.     cout<<"tong="<<(a+b)<<endl;
  18.     cout<<"hieu="<<(a-b)<<endl;
  19.     cout<<"tich="<<(a*b)<<endl;
  20.     cout<<"thuong="<<(a/b)<<endl;
  21.     return 0;
  22. }
  23. ///Bai 3
  24. #include<iostream>
  25. using namespace std;
  26. int main(){
  27.     float a;
  28.     cout<<"nhap vao so thuc a=";
  29.     cin>>a;
  30.     int phannguyen;
  31.     phannguyen=int(a);
  32.     cout<<"phan nguyen =";
  33.     cout<<phannguyen;
  34.     return 0;
  35. }
  36. ///Bai 4
  37. #include<iostream>
  38. using namespace std;
  39.     int main(){
  40.     char a;
  41.     cout<<"nhap vao mot ky tu bat ki:";
  42.     cin>>a;
  43.     a=int(a);
  44.     cout<<"ma ASCII la:"<<int(a)<<endl;
  45.     return 0;
  46.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement