The modern Olympic Games or Olympics (French: Jeux olympiques) are the leading international sporting event featuring summer and winter sports competitions in which thousands of athletes from around the world participate in a variety of competitions. The Olympic Games are considered to be the world's foremost sports competition with more than 200 nations participating. The Olympic Games are held every four years, with the Summer and Winter Games alternating by occurring every four years but two years apart. In 2016, Summer Olympics are going to be held in Rio de Janeiro, Brazil. Let's fuse Olympics with C++.
# include <iostream.h> # include <conio.h> # include <graphics.h> # include <math.h> void Circle(int Radius,int xC,int yC); void main() { int gDriver=DETECT, gMode; initgraph(&gDriver,&gMode,"c:\\tc\\bgi"); int Radius, xC, yC; cout<< endl << "Enter Center point coordinates..."; cout<<endl<<" Xc : "; cin>>xC; cout<<endl<<" Xc : "; cin>>yC; cout<<endl<<"Radius : "; cin>>Radius; cleardevice(); Circle(Radius,xC,yC); getch(); return; } void Circle(int Radius,int xC,int yC) { int P; int x,y; void Draw(int x,int y,int xC,int yC); P = 1 - Radius; x = 0; y = Radius; Draw(x,y,xC,yC); while (x<=y) { x++; if (P<0) { P += 2 * x + 1; } else { P += 2 * (x - y) + 1; y--; } Draw(x,y,xC,yC); } } void Draw(int x,int y,int xC,int yC) { putpixel(xC + x,yC + y,12); putpixel(xC + x,yC - y,12); putpixel(xC - x,yC + y,12); putpixel(xC - x,yC - y,12); putpixel(xC + y,yC + x,12); putpixel(xC - y,yC + x,12); putpixel(xC + y,yC - x,12); putpixel(xC - y,yC - x,12); }
0 comments