Bài Giảng C - Hình cpp
Trang 1
File Edit View Insert Format Tools Table Window Help Type a question for help + X -hœM.aã® &là# ao Accessories >hesNewRoman + 12 + B JZ U =|= i= i= tH t=?
@È Set Program Access and Defaults Microsoft PowerPoint
ee Windows Catalog 2 _än ,ʰT >
wy Windows Update (@) GameSpy Arcade
(&) PrintMe Internet Printing >
&> Bkav2006 [iy Adobe Reader 6.0
New Office Document © Alen shooter Derno `
a Open Office Document (E Lacwiet mtdEva 300 >
= (LAC VIET mtd2002
vài VietKey 2000 tr (E Microsoft Visual Studio 6.0 Enterprise Tools >
(@) Microsoft Web Publishing * (Œf Microsoft Visual Studio 6.0 Tools »
¥
> Documents > (3W Microsoft Visual FoxPro 6.0
- ©) Help and Support
:
))
+
2 7 Run
:
›
I@| Shut Down Ln1 Coll REC TRK EXT OVR English (U.S
Did you know
Welcome to the the Microsoft Visual C++ Developer
Studio
We've got a lot of great tips for getting the most out of
your development environment, so leave Tip of the Day
turned on for a while If you turn Tip of the Day off, it is
available fromm the Help menu
|¥ Show tips at startup Next Tip |
File / New
Trang 2New
Files | Projects | Workspaces | Other Documents |
#] Àctive Server Page
Binary File
Bitmap File
f.) C/C++ Header File
RR Cursor File
3] HTML Page
Icon File
es Macro File
Resource Script
5) Resource Template
SQL Script File
Text File
in Add to project:
| im
File name:
|viduT
Location:
ØO VAO :
& vidul.cpp *
Le
Sees
# include <iostream.h>
int a,b;
cout<< "Cho a=";
Cln>>a;
ccout<‹ "Ch: b=";
c1n>>h;
while (al=h)
{
1Í (a›h) a=a-h;
else b=b-a:
cout<<"USCLN cua 2 so do la: "“<<a<<endl:
}
# include <iostream.h>
void main()
{
int a,b;
cout<<"Cho a=";
cin>>a;
cout<<"Cho b=";
cin>>b;
while (a!=b)
{
Trang 3if (a>b) a=a-b;
else b=b-a;
}
cout<<"USCLN cua 2 so do la: "<<a<<endl;
}
Luu lai:
Dich Build / Compile
Microsoft Visual C++
7 default project workspace?
Tao : Build / Build *.exe
Chay : Build / Execute
c\ “D:\THAY TAN\Webug\vidul.exe”
b=18
USCLN cua 2 so do la : 6
Press any key to continue
File / Close Workspace :
File /New :
# include <iostream.h>
const double PI=3.1415;
void main()
{
double r,s,p;
cout<<"Cho r=";
cin>>r;
s=Pl*r*r;
p=2*PI*r;
Trang 4cout<<"Dien tich la : "<<s<<endl; cout<<"Chu vi la: "<<p<<endl;