Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///Bai 1
- #include <iostream>
- using namespace std;
- int main(){
- cout<<"Hello World";
- return 0;
- }
- ///Bai 2
- #include <iostream>
- using namespace std;
- int main(){
- int a,b;
- cout<<"nhap vao a:";
- cin>>a;
- cout<<"nhap vao b:";
- cin>>b;
- cout<<"tong="<<(a+b)<<endl;
- cout<<"hieu="<<(a-b)<<endl;
- cout<<"tich="<<(a*b)<<endl;
- cout<<"thuong="<<(a/b)<<endl;
- return 0;
- }
- ///Bai 3
- #include<iostream>
- using namespace std;
- int main(){
- float a;
- cout<<"nhap vao so thuc a=";
- cin>>a;
- int phannguyen;
- phannguyen=int(a);
- cout<<"phan nguyen =";
- cout<<phannguyen;
- return 0;
- }
- ///Bai 4
- #include<iostream>
- using namespace std;
- int main(){
- char a;
- cout<<"nhap vao mot ky tu bat ki:";
- cin>>a;
- a=int(a);
- cout<<"ma ASCII la:"<<int(a)<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement