Advertisement
Guest User

Nguyệt Nhi D19

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