Untitled
unknown
plain_text
9 months ago
2.5 kB
9
Indexable
// Tuan1_cuaHoang.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
int main()
{ /*
//Cau 2
cout << "C Language Basic Syntax Rules" << endl;
cout << " 1. Lowercase letters are significant" << endl;
cout << " 2. main is where program excution begins" << endl;
cout << " 3. Opening and closing enclose programstatements is a routine" << endl;
cout << " 4. All program statements must be terminated by a semicolon" << endl;
//Cau 4
int num1;
int num2;
cin >> num1;
cin >> num2;
cout << abs(num1 -num2) << endl;
//Cau 3
int a = 321;
int b = 123;
cout << a - b << endl;
//Cau 5
int bienx;
cin >> bienx;
cout << pow(bienx, 3) - 5 * pow(bienx, 2) + 6 << endl;
//Cau 6
cout << "Nhap ban kinh cua hinh tron" << endl;
float r;
cin >> r;
cout << "Chu vi cua hinh tron la:" << 3.14 * r * 2 << endl;
cout << "Dien tich cua hinh tron la:" << 3.14 * pow(r,2) << endl;
//Cau 7
float m;
float D;
cout << "Nhap lan luot m(Mass) va D(Density) vao di:" << endl;
cin >> m;
cin >> D;
cout << "V(volume) cua vat se bang = m / D =" << m << "*" << D << "=" << m / D;
//Cau 8
float x;
float y;
cout << "Lan luot nhap van toc cua Tuan va quang duong di hoc cua han ta:" << endl;
cin >> x;
cin >> y;
cout << "Thoi gian di hoc cua tuan la " << y / x << endl;
//Cau 9
float giatien;
cout << "nhap gia tien cua mon hang: " << endl;
cin >> giatien;
cout << "gia tien da bao ham VAT la: " << giatien * 1.1 << endl;
*/
//Cau 10
int a;
int b;
b = a % 10;
cout << b;
}
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu
// Tips for Getting Started:
// 1. Use the Solution Explorer window to add/manage files
// 2. Use the Team Explorer window to connect to source control
// 3. Use the Output window to see build output and other messages
// 4. Use the Error List window to view errors
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
Editor is loading...
Leave a Comment