Advertisement
Guest User

Untitled

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